Skip to content

Instantly share code, notes, and snippets.

@yelouafi
Created July 28, 2015 12:51
Show Gist options
  • Save yelouafi/7fe956b1bd14b983980c to your computer and use it in GitHub Desktop.
Save yelouafi/7fe956b1bd14b983980c to your computer and use it in GitHub Desktop.
function update(model, action) {
return Action.case({
Add : () => addCounter(model),
Remove : id => removeCounter(model, id),
Reset : () => resetCounters(model),
Update : (id, action) => updateCounter(model, id, action)
}, action);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment