Hi,

I am trying to figure out the best way to build up pages that have very 
little in common, but need to share something, i.e. a nav bar. The pages 
don't share messages or models, what would be the best way to implement a 
nav across both pages, and perhaps more pages in the future. 

I came up with two approaches. 

The first is to put the navigation messages at the top Msg and have all the 
pages map their Html to return the top level Msg's. I think this is cool 
because it avoids replicating the messages across the pages, but you end up 
with a bunch of Html.maps to convert everything to the top level Msg (The 
docs say "This should not come in handy too often." which got me thinking 
of how else to do this) . 

The second approach is to have each page implement all the messages for the 
nav and in the pages respective update. This seems like a bunch of 
duplication as the nav grows and does not seem like a good approach. 

Is there a better way to do this kind of thing? 

Here is some example code of what I mean 
https://gist.github.com/mdemin914/0baf793dce856ffe57ce31979ad600d6. 

Any thoughts are appreciated.

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