Created
October 23, 2016 05:48
-
-
Save tannerlinsley/8a9b8ddd707a45832cfde7a8da7eda48 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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