Created
March 6, 2019 11:39
-
-
Save tonkec/e5b561c2dead989d0dfaed2b851f5ed7 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
const incrementCount = ( {incrementBy} = {} ) => { | |
console.log(incrementBy) // propery on the payload object | |
/* | |
payload = { | |
incrementBy: 5 | |
} | |
*/ | |
return { | |
type: 'INCREMENT', | |
incrementBy: typeof incrementBy === "number" ? incrementBy : 1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment