Created
July 28, 2015 12:02
-
-
Save yelouafi/bf25399c1d179e5b4136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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