Skip to content

Instantly share code, notes, and snippets.

@dherges
Created May 11, 2018 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dherges/a070ad9f7e454ef8bb494e50f3fa5fcd to your computer and use it in GitHub Desktop.
Save dherges/a070ad9f7e454ef8bb494e50f3fa5fcd to your computer and use it in GitHub Desktop.
Selector
import { createSelector } from '@ngrx/store';
import { State } from './reducer.ts';
export const selectTodosCount = createSelector((state: State): number => {
return Object.keys(state).length;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment