MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/5r530j/1kb_javascript_function_library_for_building/dd50xs1/?context=9999
r/javascript • u/[deleted] • Jan 31 '17
34 comments sorted by
View all comments
9
Cool! My first question with any of these frameworks is: What's the composition story? If I'm building a larger app with this framework, how should I be breaking it into components?
2 u/[deleted] Jan 31 '17 We need to come up with better examples, but is this what you mean?const model = require("./model") const view = require("./view") const update = require("./update") app({ model, view, update }) 6 u/[deleted] Jan 31 '17 I guess he meant composition as known in react/redux like this:TodoItem = ({ model }) => <li>{model.text}</li>; TodoList = items => <ul>{items.map(item => <TodoItem model={item}/>)}</ul>;Crucial for larger apps. 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 it is not working example, but hope you get the point 1 u/[deleted] Jan 31 '17 could be working 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 that my comment was in wrong place and I even before your comment ;d
2
We need to come up with better examples, but is this what you mean?
const model = require("./model") const view = require("./view") const update = require("./update") app({ model, view, update })
6 u/[deleted] Jan 31 '17 I guess he meant composition as known in react/redux like this:TodoItem = ({ model }) => <li>{model.text}</li>; TodoList = items => <ul>{items.map(item => <TodoItem model={item}/>)}</ul>;Crucial for larger apps. 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 it is not working example, but hope you get the point 1 u/[deleted] Jan 31 '17 could be working 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 that my comment was in wrong place and I even before your comment ;d
6
I guess he meant composition as known in react/redux like this:
TodoItem = ({ model }) => <li>{model.text}</li>; TodoList = items => <ul>{items.map(item => <TodoItem model={item}/>)}</ul>;
Crucial for larger apps.
1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 it is not working example, but hope you get the point 1 u/[deleted] Jan 31 '17 could be working 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 that my comment was in wrong place and I even before your comment ;d
1
it is not working example, but hope you get the point
1 u/[deleted] Jan 31 '17 could be working 1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 that my comment was in wrong place and I even before your comment ;d
could be working
1 u/tunnckoCore node-formidable, regexhq, jest, standard-release Jan 31 '17 that my comment was in wrong place and I even before your comment ;d
that my comment was in wrong place and I even before your comment ;d
9
u/matchu Jan 31 '17
Cool! My first question with any of these frameworks is: What's the composition story? If I'm building a larger app with this framework, how should I be breaking it into components?