Last active
May 24, 2019 17:32
-
-
Save bradfordlemley/914a110287469b5e78380a6666529601 to your computer and use it in GitHub Desktop.
Counter using base stated library
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 createBase from './StatedLibBase'; | |
export default function createCounter() { | |
let base = createBase(0); | |
return { | |
get state() { return base.state }, | |
state$: base.state$, | |
increment() { base.setState(base.state + 1) }, | |
decrement() { base.setState(base.state - 1) }, | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment