On Sunday, February 5, 2017 at 9:37:54 PM UTC, Keith Lazuka wrote:
>
> One question you might or might not have asked yourself is whether the 
> encapsulation is worth it. Why should the `Period` state be hidden with an 
> opaque type? If you're writing a library, then, yes, it makes total sense 
> so that you can avoid having to make major version bumps as the library 
> evolves. But if this is an application-specific component which will only 
> ever be used *within* this project, then you might not need the 
> encapsulation.
>

I have to agree. I have split out pieces of re-usable view code and made 
them re-usable by passing in 'tagger's for tagging the events, but I have 
only done this for bits of view that are being re-used in multiple 
situations - a set of 'ok/cancel' buttons might be a reasonable example.

What I look for first is things that are not bound to the main Type of a 
module, and that a module does not need to expose. Recently I have been 
using some animations with elm-style-animation. I found that the animation 
styles and easings did not depend on the Model type for the module I was 
working with, and also are completely internal to it. So they were the 
first thing I moved into a separate file, purely to try and keep the main 
file shorter.

-- 
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