Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
Created November 7, 2016 21:37
Show Gist options
  • Save tannerlinsley/2820a669af083e6d3ed010e9f81bdbf9 to your computer and use it in GitHub Desktop.
Save tannerlinsley/2820a669af083e6d3ed010e9f81bdbf9 to your computer and use it in GitHub Desktop.
import { Hook, Actions } from 'jumpsuit'
Hook((action, getState) => {
// Never letting the counter equal 10!
if (getState().counter.count === 10) {
Math.random() > 0.5 ? Actions.increment() : Actions.decrement()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment