Skip to content

Instantly share code, notes, and snippets.

@vzaidman
Last active October 7, 2017 18:44
Show Gist options
  • Save vzaidman/619c51d0c6979b9c9b93cee3ece60e33 to your computer and use it in GitHub Desktop.
Save vzaidman/619c51d0c6979b9c9b93cee3ece60e33 to your computer and use it in GitHub Desktop.
Action Creators Execution
import { increaseBy } from './actions'
// The redux toolbelt action creator "increaseBy"
// contains TYPE- the type of the action it creates.
increaseBy.TYPE
// ⇒ 'INCREASE_BY'
increaseBy(10)
// ⇒ {
// type: 'INCREASE_BY',
// payload: 10
// }
increaseBy(10, { userAction: true })
// ⇒ {
// type: 'INCREASE_BY',
// payload: 10,
// meta: { userAction: true }
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment