Created
February 20, 2019 07:02
-
-
Save lydemann/afa3f9eb5b77ad579390002d17b22876 to your computer and use it in GitHub Desktop.
todo-list.selector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const getTodolistState = createFeatureSelector<TodoListState>('todoList'); | |
export const todoListSelectorFn = createSelector( | |
getTodolistState, | |
(todoListState) => todoListState.todos | |
); | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class TodoListSelector { | |
/** | |
* | |
*/ | |
constructor(private store: Store<TodoListState>) {} | |
/** | |
* getTodoList | |
*/ | |
public getTodoList() { | |
return this.store.select(todoListSelectorFn); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment