Skip to content

Instantly share code, notes, and snippets.

@lydemann
Created February 20, 2019 07:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lydemann/0226315feeecb64969d8f9d06536c96f to your computer and use it in GitHub Desktop.
todo-list.actions.ts
@Injectable({ providedIn: 'root' })
export class TodoListActions {
constructor(private store: Store<TodoListState>) {}
public loadTodoList(): void {
this.store.dispatch(new LoadTodoList());
}
public deleteTodo(id: string) {
this.store.dispatch(new TodoItemDeleted(id));
}
public todoItemUpdated(id: string) {
this.store.dispatch(new TodoItemDeleted(id));
}
public todoItemCompleted(id: string) {
this.store.dispatch(new TodoItemCompleted(id));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment