Skip to content

Instantly share code, notes, and snippets.

@daveharmswebdev
Created November 14, 2017 13:15
Show Gist options
  • Save daveharmswebdev/573aece56034bfbee4fd131bbc80c763 to your computer and use it in GitHub Desktop.
Save daveharmswebdev/573aece56034bfbee4fd131bbc80c763 to your computer and use it in GitHub Desktop.
todo-list.actions.ts
import { Action } from '@ngrx/store';
import { ITodoList, ITodo } from '../models';
export const FETCH_LISTS = 'FETCH_LISTS';
export const FETCH_LISTS_SUCCESS = 'FETCH_LISTS_SUCCESS';
export const SELECT_LIST = 'SELECT_LIST';
export const FETCH_TODOS = 'FETCH_TODO';
export const FETCH_TODOS_SUCCESS = 'FETCH_TODO_SUCCESS';
export class FetchList implements Action {
readonly type = FETCH_LISTS;
}
export class FetchListSuccess implements Action {
readonly type = FETCH_LISTS_SUCCESS;
constructor(public payload: ITodoList[]) {}
}
export class SelectList implements Action {
readonly type = SELECT_LIST;
constructor(public payload: number) {}
}
export class FetchTodos implements Action {
readonly type = FETCH_TODOS;
constructor(public payload: number) {}
}
export class FetchTodosSuccess implements Action {
readonly type = FETCH_TODOS_SUCCESS;
constructor(public payload: ITodo[]) {}
}
export type All
= FetchList
| FetchListSuccess
| SelectList
| FetchTodos
| FetchTodosSuccess;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment