I’m having trouble understanding the right structure for a relatively simple 
app. I’m thinking of this in actor-ish terms, which is probably wrong. 

There’s a Main model that has the state of an animation. One part is the 
animation's speed. At times, the user will want to change that speed. 

At the moment, the user will do that by typing numbers into a text field and 
then hitting a “Change” button. In the future, control will be via something 
more like a slider.

I want the Main model’s associated `update` to be unaffected by that future 

To me, that implies that `Controller` should have its own `model`, `update`, 
`view`, and `subscriptions`. It should be its own little machine that gets 
started by Main then operates independently to periodically send commands. It 
seems natural to put all that into its own `Controller.elm` separate from 
`Main.elm`. (For example, let’s say that the text field will only allow valid 
integers. Seems like the `onInput` update that checks the current contents of 
the text field should be part of an isolated “component.”)

Does this make sense?

What’s the right way to wire all this together?

Sample code?

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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to