Skip to content

Instantly share code, notes, and snippets.

@weslleyaraujo
Created December 21, 2016 17:46
Show Gist options
  • Save weslleyaraujo/3cbe0ba6e3bb2f4f58df0a7daf654c7f to your computer and use it in GitHub Desktop.
Save weslleyaraujo/3cbe0ba6e3bb2f4f58df0a7daf654c7f to your computer and use it in GitHub Desktop.
const start = createAction(START_GAME);
const next = createAction(NEXT_LEVEL);
const startGame = payload => start({ next: getRandomId() });
const nextLevel = payload => next({ next: getRandomId() });
startGame(); // { type: ‘START_GAME’, payload: { next: ‘red’ } }
startGame(); // { type: ‘START_GAME’, payload: { next: ‘blue’ } }
startGame(); // { type: ‘START_GAME’, payload: { next: ‘yellow’ } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment