Skip to content

Instantly share code, notes, and snippets.

@reciosonny
Created October 14, 2018 05:15
Show Gist options
  • Select an option

  • Save reciosonny/e92640a6beb9c30da8c58d5c46b8f66f to your computer and use it in GitHub Desktop.

Select an option

Save reciosonny/e92640a6beb9c30da8c58d5c46b8f66f to your computer and use it in GitHub Desktop.
Flux sample action creators
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