Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Created July 28, 2015 12:02
Show Gist options
  • Save yelouafi/bf25399c1d179e5b4136 to your computer and use it in GitHub Desktop.
Save yelouafi/bf25399c1d179e5b4136 to your computer and use it in GitHub Desktop.
function updateCounter(model, id, action) {
return {...model,
counters : model.counters.map(item =>
item.id !== id ?
item
: { ...item,
counter : counter.update(item.counter, action)
}
)
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment