Skip to content

Instantly share code, notes, and snippets.

@joelgrus
Last active January 24, 2016 15:15
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 joelgrus/b344c9d166577c7104ec to your computer and use it in GitHub Desktop.
Save joelgrus/b344c9d166577c7104ec to your computer and use it in GitHub Desktop.
sort-of explicit state in cycle.js
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