Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created February 28, 2014 08:13
Show Gist options
  • Save Raynos/9267250 to your computer and use it in GitHub Desktop.
Save Raynos/9267250 to your computer and use it in GitHub Desktop.
function main(initialState, render) {
...
return {
update: function (currentState) {},
elem: ...
}
}
var state = ObservHash({
...
})
function render(state) {
return h("div", [ ... ])
}
var loop = main(state(), render)
state(loop.update)
document.body.appendChild(loop.elem)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment