core/common/user-preferences/user-preferences.service.ts
Properties |
Methods |
constructor(user: UserService, inventory: InventoryService, appState: AppStateService)
|
||||||||||||
Parameters :
|
get | ||||||||
get(key: string)
|
||||||||
Get an Observable value for searched key for current user.
Parameters :
Returns :
Observable<any>
An Observable with the value of preference. |
getForUser | ||||||||||||
getForUser(key: string, user: IUser)
|
||||||||||||
Get an Observable value of searched key for a specific user.
Parameters :
Returns :
Observable<any>
An Observable with the value of preference. |
observe | ||||||||
observe(key: string)
|
||||||||
Type parameters :
|
||||||||
Returns an observable of a user preference with given key. Emits its initial value first and then updated values when set by user.
Parameters :
Returns :
Observable<T>
An Observable of a user preference. |
set | ||||||||||||
set(key: string, value: any)
|
||||||||||||
Sets a value in storage for current user.
Parameters :
Returns :
Promise<any>
A promise with saved value. |
setForUser | ||||||||||||||||
setForUser(key: string, value: any, user: IUser)
|
||||||||||||||||
Sets a value in storage for a specific user.
Parameters :
Returns :
Promise<any>
A promise with saved value. |
currentUser |
Type : Observable<IUser>
|
preferenceChanges$ |
Type : Subject<UserPreference>
|
Default value : new Subject()
|