Skip to content

Commit

Permalink
[base] Provide user store to user color singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent b55a4a3 commit d763499
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/@sanity/base/src/user-color/singleton.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import userStore from 'part:@sanity/base/user'
import {createUserColorManager} from './manager'

export const userColorManager = createUserColorManager()
export const userColorManager = createUserColorManager({userStore})
6 changes: 3 additions & 3 deletions packages/@sanity/base/src/user-color/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface UserColorManager {
}

export interface ManagerOptions {
userStore?: {currentUser: Observable<{type: 'snapshot' | 'error'; user: {id: string} | null}>}
colors: Readonly<Record<UserColorHue, UserColor>>
currentUserColor: UserColorHue
userStore?: {currentUser: Observable<{type: 'snapshot' | 'error'; user?: {id: string} | null}>}
colors?: Readonly<Record<UserColorHue, UserColor>>
currentUserColor?: UserColorHue
}

0 comments on commit d763499

Please sign in to comment.