22 lines
466 B
TypeScript
22 lines
466 B
TypeScript
|
import { Selector, createSelector } from '@ngrx/store';
|
||
|
import { UserInfo } from '@ucap-webmessenger/protocol-sync';
|
||
|
|
||
|
export interface State {
|
||
|
buddyInfoList: UserInfo[];
|
||
|
buddy2SyncDate: string;
|
||
|
}
|
||
|
|
||
|
export const initialState: State = {
|
||
|
buddyInfoList: [],
|
||
|
buddy2SyncDate: ''
|
||
|
};
|
||
|
|
||
|
export function selectors<S>(selector: Selector<any, State>) {
|
||
|
return {
|
||
|
buddyInfoList: createSelector(
|
||
|
selector,
|
||
|
(state: State) => state.buddyInfoList
|
||
|
)
|
||
|
};
|
||
|
}
|