Created
November 14, 2017 13:15
-
-
Save daveharmswebdev/573aece56034bfbee4fd131bbc80c763 to your computer and use it in GitHub Desktop.
todo-list.actions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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