Created
March 6, 2019 11:41
-
-
Save tonkec/5ff44dd0d850d04ce5cf5ce9a644d918 to your computer and use it in GitHub Desktop.
default value is set to 1
This file contains hidden or 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 = 1 } = {} ) => { | |
console.log(incrementBy) // propery on the payload object | |
/* | |
payload = { | |
incrementBy: 5 | |
} | |
*/ | |
return { | |
type: 'INCREMENT', | |
incrementBy: incrementBy | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment