DEV Community

Discussion on: The basic Elm example that I wish I'd had

Collapse
 
pasdut profile image
Pascal

Hi Nimmo,

We are now more than a year further of your original post. Do you still use the same structure? Or did you find another way to organize (after gaining more experience)?

Collapse
 
pasdut profile image
Pascal

Strange...it says I posted this in dec 18 while we are dec 19

Collapse
 
nimmo profile image
Nimmo

Hey, yeah I'm still doing this (i.e., this way: dev.to/nimmo/comment/6i4n ), and have been full-time in production for months now. It's really nice!

I have an overall model in Main which is a record, that has a state, and my states in Main tend to be things like ViewingPageX PageX.Model | ViewingPageY PageY.Model etc. etc., and then PageX.Model and PageY.Model would either just be a custom type that defined the states of their own pages, or they might also be a record if there's some info that needs to be available in every state (like, for example, an environment definition or something).

Does that help? :)

Thread Thread
 
pasdut profile image
Pascal

Thanks for your feedback. This certainly helps. I like well structured code and like to learn from people more experienced with elm. Tutorials only cover small stuff...

Collapse
 
nimmo profile image
Nimmo

Also I think the Dec 18 on the comment is because it is the 18th of December, not December 2018! :D

Thread Thread
 
pasdut profile image
Pascal

Of course, stupid me...

Thread Thread
 
nimmo profile image
Nimmo

Not at all! Incredibly easy mistake to have made, just happened to be literally the only day of the year that it would have happened. :D