Skip to content

Instantly share code, notes, and snippets.

@kastigar
Created September 13, 2016 15:44
Show Gist options
  • Save kastigar/2b770559e8821212debb5b404bd148ca to your computer and use it in GitHub Desktop.
Save kastigar/2b770559e8821212debb5b404bd148ca to your computer and use it in GitHub Desktop.
export const addStep = actionCreator(
setType('addStep'),
withReducer.inPath('turn.steps', (atom, card) => [...atom, card]),
);
export const finishTurn = actionCreator(
setType('finishTurn'),
withReducer.inPath('turn.done', () => true),
);
export const unfinishTurn = actionCreator(
setType('unfinishTurn'),
withReducer.inPath('turn.done', () => false),
withReducer.inPath('turn.steps', () => []),
);
export const selectOption = actionCreator(
setType('selectOption'),
withReducer.inPath('turn.analyzed', (atom, option) => [...atom, option]),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment