On Wednesday, January 25, 2017 at 3:25:56 PM UTC, Alex Barry wrote: > > we tried to stick to generally Module.View, Module.Update, and > Module.Model. We had a few instances where we had to break out sub-update > messages (ie the union type typically used in Module.Update) because we had > messages that passed messages. >
Thanks for your thoughts. I presume your Model/Update/View split is very similar to the Types/State/View split? or perhaps you put more than the Type definitions in your Model.elm? I'm definitely moving away from this pattern for reasons already stated. > Also for methods, only pass what you need, even if it means passing and > returning more data. I eliminated a handful of circular dependencies just > by doing that. > > Only break things out if there is a reason to. > Yeah, I'm not turing things into TEA component unnecessarily. Often I won't go as for as making a complete component - more often that not its the view that grows in size, and I end up pulling out bits of view code into functions, so that is often the first thing to get split out into modules. Passing only what is needed is the way to do this :-) Typically I am lazy the first time round and just pass the whole Model down the view, then a bit of refactoring to make functions only consume what they need. -- 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.
