Created
April 11, 2017 16:01
-
-
Save aGuyNamedJonas/8559f6940d67d31cfdeb62df58901dc4 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
// Calling increment() will dispatch the following action: | |
// {type: 'INCREMENT', payload: {value: 10}} | |
increment({value: 10}); | |
/* | |
This will be picked up by your reducer: | |
reducer: (state, payload, action) => { | |
return state + payload.value; | |
} | |
And will trigger the store.subscribe() function to output the new state: | |
10 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment