Skip to content

Instantly share code, notes, and snippets.

@nomanHasan
Created October 11, 2017 10:01
Show Gist options
  • Save nomanHasan/8d3176d4b36ee93927b03dd1dc965a30 to your computer and use it in GitHub Desktop.
Save nomanHasan/8d3176d4b36ee93927b03dd1dc965a30 to your computer and use it in GitHub Desktop.
5 #todoapp-angular-ngrx
// ........................
export function TodoReducer(state = defaultState, action: Action) {
switch (action.type) {
//...............
case TodoActions.GET_TODOS_SUCCESS: {
return {
...state,
todos: [
...action.payload,
defaultTodoStates[0]
],
loading: false
};
}
//...............
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment