index.ts 541 B

123456789101112
  1. import { createSelector } from 'reselect';
  2. import { IState } from '../../../typescript/redux/interfaces'
  3. const getTotal = (state: IState) => state.contacts.total;
  4. const getLimit = (state:IState) => state.contacts.limit;
  5. const getPage = (state: IState) => state.contacts.page;
  6. const getContacts = (state: IState) => state.contacts.contacts;
  7. const getState = (state: IState) => state.contacts;
  8. const getContactsMemo = createSelector([getContacts], state => state);
  9. export { getTotal,getLimit,getPage,getContacts,getState,getContactsMemo };