todo-list.selector.ts
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