Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
export class TodoListComponent implements OnInit {
public selectedTodo$ = this.todoListSandboxService.selectedTodo$;
public todoList: TodoItem[];
public isLoading = false;
constructor(private todoListSandboxService: TodoListSandboxService) {}
public ngOnInit(): void {
// mapping to state property - don't do this!
this.todoListSandboxService.todoList$.subscribe(todoList => {
this.todoList = todoList;
this.todoListSandboxService.isLoading$.subscribe(isLoading => {
this.isLoading = isLoading;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment