Skip to content

Instantly share code, notes, and snippets.

@konekoya
Created November 17, 2016 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konekoya/b60b2395ed1102d5ba9885ce29bca5b6 to your computer and use it in GitHub Desktop.
Save konekoya/b60b2395ed1102d5ba9885ce29bca5b6 to your computer and use it in GitHub Desktop.
Object.assign
export default function courseReducer(state = [{title: 'oh'}, {title: 'yes'}], action) {
debugger;
switch(action.type) {
case 'CREAGE_COURESE':
return [...state, action.course];
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment