Skip to content

Instantly share code, notes, and snippets.

@tannerlinsley
Created October 23, 2016 05:48
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 tannerlinsley/8a9b8ddd707a45832cfde7a8da7eda48 to your computer and use it in GitHub Desktop.
Save tannerlinsley/8a9b8ddd707a45832cfde7a8da7eda48 to your computer and use it in GitHub Desktop.
import Jumpstate from 'jumpstate'
export const CounterState = Jumpstate({
// Initial State
initial: {
count: 0
},
// Actions
increment (state) {
return { count: ++state.count }
},
decrement (state) {
return { count: --state.count }
}
})
export function incrementAsync () {
setTimeout(() => {
CounterState.increment()
}, 5000)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment