Skip to content

Instantly share code, notes, and snippets.

@cutecycle
Created June 3, 2017 02:21
Show Gist options
  • Save cutecycle/af71cbc22915718de44da421e0d50b11 to your computer and use it in GitHub Desktop.
Save cutecycle/af71cbc22915718de44da421e0d50b11 to your computer and use it in GitHub Desktop.
a(state) {
state.x = 5;
}
b(state) {
out = state;
out.x = 5;
return out;
}
c(state) {
state.x = 5;
return state;
}
@asonge
Copy link

asonge commented Jun 3, 2017

d(state) {
  return Object.assign({}, state, {x: 5});
}

e(state) {
  return {...state, x: 5};
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment