signal-desktop/ts/state/selectors/user.ts

24 lines
588 B
TypeScript
Raw Normal View History

2019-01-14 21:49:58 +00:00
import { createSelector } from 'reselect';
import { LocalizerType } from '../../types/Util';
import { StateType } from '../reducer';
import { UserStateType } from '../ducks/user';
export const getUser = (state: StateType): UserStateType => state.user;
export const getUserNumber = createSelector(
getUser,
(state: UserStateType): string => state.ourNumber
);
export const getRegionCode = createSelector(
getUser,
(state: UserStateType): string => state.regionCode
);
export const getIntl = createSelector(
getUser,
(state: UserStateType): LocalizerType => state.i18n
);