Skip to content

Instantly share code, notes, and snippets.

@lydemann
Last active July 6, 2018 18:05
Show Gist options
  • Save lydemann/27cea0d6872d435d11d157871916e593 to your computer and use it in GitHub Desktop.
Save lydemann/27cea0d6872d435d11d157871916e593 to your computer and use it in GitHub Desktop.
import { Observable } from 'rxjs/Observable';
import { Injectable } from '@angular/core';
import { AppState } from '@app/store/state.model';
import { select } from '@angular-redux/store';
import { TODOItem } from '@app/shared/models/todo-item';
export const todoListSelector = (appState: AppState) => appState.todoList.todos;
@Injectable()
export class TodoListSelector {
@select(todoListSelector) todoList$: Observable<TODOItem[]>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment