Skip to content

Instantly share code, notes, and snippets.

@yackinn
Created January 19, 2021 10:39
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 yackinn/bd773a4263ad42a08c7ed42287824aaa to your computer and use it in GitHub Desktop.
Save yackinn/bd773a4263ad42a08c7ed42287824aaa to your computer and use it in GitHub Desktop.
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit{
currentTodo = ""
todos$: Observable<Todo[]>
constructor(
private todoQuery: TodoQuery,
private actions$: Actions,
) {
}
ngOnInit() {
this.actions$.dispatch(TodoActions.loadTodos())
this.todos$ = this.todoQuery.selectAll$
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment