forest. Returning some stores(or probably another units) from component. Pattern or AntiPatern? #607
Unanswered
ilyaagarkov
asked this question in
Q&A
Replies: 1 comment 2 replies
-
If resulting units are planned to be used further, I would rather go with separated View and Model layers, e.g.: function createFiltersFormModel(config) {
const $filter = createStore(...);
...
return { $filter, searchChanged, filterChanged }
}
function FiltersForm(model) {
Header(() => {
Search({
attr: {
value: model.$filter,
placeholder: 'Type a part of store name',
},
handler: { input: model.searchChanged },
});
})
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This code looks very useful to me.
It's a way to reuse some components with getting access to their "internal state"
But I know nothing about forest
Is it a good idea or it might provide some problems?
Beta Was this translation helpful? Give feedback.
All reactions