Created
December 24, 2019 13:56
-
-
Save lydemann/e533318933d854374a2b8e19f8187591 to your computer and use it in GitHub Desktop.
todo-list.reducers.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
export const todoListReducers = createReducer( | |
todoListInitState, | |
on(TodoListActions.getTodoListRequest, state => { | |
return { | |
...state, | |
isLoading: true, | |
}; | |
}), | |
on(TodoListActions.getTodoListResponse, (state, action) => { | |
return { | |
...state, | |
todos: action.todoList, | |
isLoading: false, | |
}; | |
}), | |
on(TodoListActions.getTodoListFailed, (state, action) => { | |
return todoItemsLoadFailed(state, action); | |
}), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment