Last active
September 20, 2016 04:25
Revisions
-
TheSeamau5 revised this gist
Sep 20, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ // makeRunner : (renderer : ReactComponent -> ()) // -> (update : s -> a -> s, render : s -> Dispatcher a -> ReactComponent, observable : Observable a) // -> () export const makeRunner = (renderer) => (update, render, observable) => { const store = createStore(update); -
TheSeamau5 created this gist
Sep 20, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ export const makeRunner = (renderer) => (update, render, observable) => { const store = createStore(update); const renderApp = () => renderer(render(store.getState(), store.dispatch)); renderApp(); if (observable) { observable.subscribe(store.dispatch); } store.subscribe(renderApp); };