Skip to content

Instantly share code, notes, and snippets.

@aGuyNamedJonas
Created April 11, 2017 16:01
Show Gist options
  • Save aGuyNamedJonas/8559f6940d67d31cfdeb62df58901dc4 to your computer and use it in GitHub Desktop.
Save aGuyNamedJonas/8559f6940d67d31cfdeb62df58901dc4 to your computer and use it in GitHub Desktop.
// 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