I am unable to load https://guide.elm-lang.org/types/union_types.html due to a broken certificate chain error for the site (the certificate itself is fine, but its chain to the parents is broken), what is up?
As for your question, it looks fine, but are you wondering about it not being more easily extendable or so? If so you could always encode a Dict with String key and a function of `Model -> Html Msg` that you can dynamically add remove views too with a key of the active view. That would be storing functions in the model though, which is generally frowned upon due to it making debugging more difficult. It is hard to do that more 'generic' though as the Elm language is designed to be simple for ease of use and lacks the higher constructs (which is a good thing for people learning this). Explicit is better than Implicit as the saying goes. :-) On Friday, November 4, 2016 at 7:07:00 AM UTC-6, Samuel Müller wrote: > > Hi All, > > i'm trying to build an application that is similar to the Widget Dashboard > example from here: https://guide.elm-lang.org/types/union_types.html > > My specific usecase is this: i have a view which, depending on what the > user has entered into a form, shows a specific "sub view". I call this sub > view a "plugin", and one would refer to it as a web component outside of > elm world. Check it out here: > > https://github.com/samu/coversheets > > What i dont like about my approach is the code on these lines: > https://github.com/samu/coversheets/blob/7c9df68c99f7346c6e7491c9d8ef99a9d5c64f26/src/Plugins/PluginDispatcher.elm#L37 > > Is it possible to do this in a nicer, more generic way? Or is my way of > structuring the app insufficient in the first place? > > -- 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.
