Last active
January 24, 2016 15:15
-
-
Save joelgrus/b344c9d166577c7104ec to your computer and use it in GitHub Desktop.
sort-of explicit state in cycle.js
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
const State = Immutable.Record({count:0}); | |
const state$ = action$.startWith(new State()) | |
.scan((state, delta) => state.updateIn(['count'], count => count + delta)); | |
const vtree$ = state$.map(...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment