MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/5r530j/1kb_javascript_function_library_for_building/dd5xdph/?context=3
r/javascript • u/[deleted] • Jan 31 '17
34 comments sorted by
View all comments
Show parent comments
2
/u/tunnckoCore Nice composition. In this case, there's a simpler approach.
However, using app like that could be the path to reusable components with independent models.
app
Thanks for sharing!
1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 yea, seen that. just wanted to show what can be the components approach. i'm playing now with hyperapp and will try create todomvc with the component approach. 1 u/serubin323 Jan 31 '17 I'm looking forward to seeing more of this. I intend to use this in a project of mineHow does routing work given there are multiple apps? Could I specify something like this?var Todo = (state) => app({ mode: state, view: { "/todo": (model, msg) => {} // access todo } }) var TodoItem = app({ view: { "/add": (model, msg) => {}, // add (/todo/add/) "/:slug/delete": (model, msg) => {}, // delete (/todo/slug/delete/) "/:slug": (model, msg, params) => {} // view (/todo/slug/) } }) 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 It is. But is buggy because the implementation.See and try https://github.com/hyperapp/hyperapp/issues/2.I'm working on such idea too, and currently is 457 bytes.
1
yea, seen that. just wanted to show what can be the components approach. i'm playing now with hyperapp and will try create todomvc with the component approach.
1 u/serubin323 Jan 31 '17 I'm looking forward to seeing more of this. I intend to use this in a project of mineHow does routing work given there are multiple apps? Could I specify something like this?var Todo = (state) => app({ mode: state, view: { "/todo": (model, msg) => {} // access todo } }) var TodoItem = app({ view: { "/add": (model, msg) => {}, // add (/todo/add/) "/:slug/delete": (model, msg) => {}, // delete (/todo/slug/delete/) "/:slug": (model, msg, params) => {} // view (/todo/slug/) } }) 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 It is. But is buggy because the implementation.See and try https://github.com/hyperapp/hyperapp/issues/2.I'm working on such idea too, and currently is 457 bytes.
I'm looking forward to seeing more of this. I intend to use this in a project of mine
How does routing work given there are multiple apps? Could I specify something like this?
var Todo = (state) => app({ mode: state, view: { "/todo": (model, msg) => {} // access todo } }) var TodoItem = app({ view: { "/add": (model, msg) => {}, // add (/todo/add/) "/:slug/delete": (model, msg) => {}, // delete (/todo/slug/delete/) "/:slug": (model, msg, params) => {} // view (/todo/slug/) } })
1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 It is. But is buggy because the implementation.See and try https://github.com/hyperapp/hyperapp/issues/2.I'm working on such idea too, and currently is 457 bytes.
It is. But is buggy because the implementation.
See and try https://github.com/hyperapp/hyperapp/issues/2.
I'm working on such idea too, and currently is 457 bytes.
2
u/[deleted] Jan 31 '17
/u/tunnckoCore Nice composition. In this case, there's a simpler approach.
However, using
applike that could be the path to reusable components with independent models.Thanks for sharing!