Skip to content

Instantly share code, notes, and snippets.

@peterbsmyth
Created July 8, 2016 20:51
Show Gist options
  • Save peterbsmyth/ff3175f7aca2b8595b6cbbfe34fc2249 to your computer and use it in GitHub Desktop.
Save peterbsmyth/ff3175f7aca2b8595b6cbbfe34fc2249 to your computer and use it in GitHub Desktop.
const let reducer = (state={}, action) => {
switch(action.type) {
case RELEVANT_REQUEST:
let nextState;
if (!state[action.day]) {
nextState = Object.assign({}, state, { [action.day]: {} });
}
// Do stuff here
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment