Skip to content

Instantly share code, notes, and snippets.

@roberto
Last active January 24, 2018 21:15
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 roberto/2d4d483c47c6ef414d206e62199f5474 to your computer and use it in GitHub Desktop.
Save roberto/2d4d483c47c6ef414d206e62199f5474 to your computer and use it in GitHub Desktop.
const increment = (key, obj) => {
return {
...obj,
[key]: obj[key] + 1
}
}
const increment = (key, obj) =>
({...obj, [key]: obj[key] + 1})
const increment = (key, obj) =>
R.evolve({[key]: R.inc}, obj)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment