3 ms·
I really would like to see an article about this, can you point me in the right direction. Natural component composition(nesting) where "component" includes mar
by dustingetz 11y ago
I really would like to see an article about this, can you point me in the right direction. Natural component composition(nesting) where "component" includes markup, state and events, and how cyclejs makes this better. This is the article Andre should have written btw, i think vanilla react doesn't handle this all that well and redux makes the composition story worse (composition is a non-goal of redux though) - but it is very much still a research problem
- sotojuan 11y agoCheck out the Cycle docs: http://cycle.js.org/getting-started.html http://cycle.js.org/getting-started.html
- slorber 11y agoIt's easy to use Redux in a composable way once you start removing imperative code in components and just make them describe what happened. Redux-saga can glue this all together. See http://stackoverflow.com/a/34584313/82609 http://stackoverflow.com/a/34584313/82609
- sotojuan 11y agoThanks. I have redux-saga starred on Github but haven't looked into it at all.
- leeoniya 11y agoTake a look at domvm [1], disclaimer: mine. It was written expressly to allow for imperative AND declarative sub-view composition using a concise, js syntax. I used Mithril for a while before needing granular redraw and concluding that MVC wasn't the way to go. ~8k min. No build tools, no dependencies. Extremely fast [2], composable, isomporphic. JSONML [3] superset template syntax. it's plain js all the way down. [1] https://github.com/leeoniya/domvm https://github.com/leeoniya/domvm [2] http://leeoniya.github.io/domvm/test/bench/dbmonster/ http://leeoniya.github.io/domvm/test/bench/dbmonster/ [3] http://www.jsonml.org/ http://www.jsonml.org/
- dustingetz 11y agoI dont think this is the type of composition I am talking about. This composes pure views, like react, but it doesn't compose their state, same as react.
- leeoniya 11y agocontinued in https://github.com/leeoniya/domvm/issues/8 https://github.com/leeoniya/domvm/issues/8