Last active
October 7, 2017 18:44
-
-
Save vzaidman/619c51d0c6979b9c9b93cee3ece60e33 to your computer and use it in GitHub Desktop.
Action Creators Execution
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
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