Skip to content

Instantly share code, notes, and snippets.

@daniele-zurico
Created June 19, 2018 18:14
Show Gist options
  • Save daniele-zurico/05861dd9291035e76be2f5a0513a7c8a to your computer and use it in GitHub Desktop.
Save daniele-zurico/05861dd9291035e76be2f5a0513a7c8a to your computer and use it in GitHub Desktop.
export const getHeroesState = createFeatureSelector<fromHeroes.State>('heroes');
export const getHeroes = createSelector(getHeroesState, state => state.data);
export const getIsLoading = createSelector(getHeroesState, state => state.isLoading);
export const getCurrentPage = createSelector(getHeroesState, state => state.page);
export const getIsFirstPage = createSelector(getHeroesState, state => !state.previous);
export const getIsLastPage = createSelector(getHeroesState, state => !state.next);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment