Created
October 11, 2017 09:57
-
-
Save nomanHasan/57bd4aeb246a3dba97eff1275e914b12 to your computer and use it in GitHub Desktop.
1 #todoapp-angular-ngrx
This file contains hidden or 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 Todo from '../../models/todo.model'; | |
import { initializeTodoState, TodoListState, TodoState } from './todo.state'; | |
import * as TodoActions from './todo.action'; | |
export type Action = TodoActions.All; | |
const defaultTodoStates: TodoState[] = [ | |
{ | |
...Todo.generateMockTodo(), | |
...initializeTodoState() | |
} | |
] | |
const defaultState: TodoListState = { | |
todos: defaultTodoStates, | |
loading: false, | |
pending: 0 | |
} | |
export function TodoReducer(state = defaultState, action: Action) { | |
console.log(state, action); | |
switch (action.type) { | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment