I have an elm application designed with elm architecture in mind. I used it for all the samples in the tutorial and they work great. I have the following components
- ContainerListView
- Containerview
- Addressview
- RegistrationView
- ...
The ContainerView component is a very formatted div structure that is used to store other views (but so far only one at a time)
ContainerListView can contain multiple containers. He handles their presentation and positioning. You can think of it as an MDI surface
The menu from the main ui is used to add new container views to the container watch list.
I am presented with three main questions. Two of them are
How to create such components so that the container view can contain any other element, I pass, for example, the init, update and view functions and expect all things to be connected correctly? At the moment, the samle looks that I have have been hard-coded. They know exactly who the children are.
Some components require access to things like url, access token, etc. Should it always be passed from main to the individual components, or can it come from another source, which will essentially be read-only and possibly updated only from the main?
I am not sure that these two questions should be individual. Any information on how to architect larger applications with a welcome world will also be appreciated.
source share