Skip to content

Instantly share code, notes, and snippets.

@tonkec
Created March 6, 2019 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonkec/5ff44dd0d850d04ce5cf5ce9a644d918 to your computer and use it in GitHub Desktop.
Save tonkec/5ff44dd0d850d04ce5cf5ce9a644d918 to your computer and use it in GitHub Desktop.
default value is set to 1
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