-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Communication between components #7
Comments
hey @jscriptcoder! |
For my latest project I'm using a flat hierarchy made with extensible records which means that most of the time you simply don't need to communicate from child to parent (Noah at NoRedInk came up with this, btw, not me :) ) I don't think its the standard way, but I've found that it works really well; I'll happily show you tonight. |
Yes, we use that sometimes. But it's also okay to just pass parts of the model to the child view. One pattern I recently like is (without extensible records): select : Model -> SubModel
select model =
{ disabled = List.isEmpty model.users
, userCount = List.length model.users
}
subView : SubModel -> Html msg
subView model =
-- display stuff
-- in parent
subView (select model) |
Great... thanks guys. Looking forward to tonight's meetup |
Hi there,
this is something I ran into when playing around with Elm. Currently I'm working on a personal project, quite componentized (if that word even exists), where I need to pass information from child to parent (sometimes three levels up), child to child or even component to component that aren't in the same branch. I figured out a few possible solutions, but it would be great to have a talk about it since I don't even know if that's the right way or there is a better one, sort of standard way.
Thanks in advance
The text was updated successfully, but these errors were encountered: