Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created December 28, 2019 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/51cd6524b796471f1a06aa11fbf48231 to your computer and use it in GitHub Desktop.
Save IntegerMan/51cd6524b796471f1a06aa11fbf48231 to your computer and use it in GitHub Desktop.
const gameReducer = createReducer(GameSimulator.buildDefaultState(),
on(resetAction, () => GameSimulator.buildDefaultState()),
on(nextTurnAction, state => GameSimulator.simulate(state, 1)),
on(clearAction, state => { ... state, messages: [] })
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment