Hello,

How do you typically architecture child components that have a shared model  
owned by a higher component in the hierarchy ?

Let say I have component P with a model resembling this
 
type alias Model = {...,list: List SharedModel}

SharedModel is actually defined in a separated module. 

P has two child components c1 and c2 displayed at the same time. Those 
components needs to access to the selected SharedModel in list. 

Both the model of c1 and c2 will therefore contain a copy of the selected 
SharedModel

Most of the updates c1 and c2 need to perform on SharedModel are common. I was 
thinking of putting them in the form of utility function in the SharedModel 
module and call them from the parent component P

This somewhat resembles the flux architecture where a central store is updated 
by the react components sharing common actions which then update the component 
views in cascade from the top. 
 
Is that the correct way to do it ?

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to