Created
October 14, 2018 05:15
-
-
Save reciosonny/e92640a6beb9c30da8c58d5c46b8f66f to your computer and use it in GitHub Desktop.
Flux sample action creators
This file contains hidden or 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 AppDispatcher from './AppDispatcher'; | |
| export const updateNumberOfPeople = (value) => { | |
| const action = { type: 'UPDATE_NUMBER_OF_PEOPLE', value }; | |
| AppDispatcher.dispatch(action); | |
| } | |
| export const updateSlicesPerPerson = (value) => { | |
| AppDispatcher.dispatch({ | |
| type: 'UPDATE_SLICES_PER_PERSON', | |
| value | |
| }); | |
| } | |
| export const reset = () => { | |
| AppDispatcher.dispatch({ type: 'RESET' }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment