Re:Optimistic UI and Reactive Programming with Elm
by skybrian on Sunday July 26, 2015 @07:02PM
(#9952515)
Composition of components in Elm is still being worked out, to judge by discussions on the mailing list [1], [2]. To do things like animating components, you still need to store the temporary state somewhere.
[1] https://groups.google.com/forum/?fromgroups#!searchin/elm-di...
[2] https://groups.google.com/forum/?fromgroups#!topic/elm-discu...
Re:Optimistic UI and Reactive Programming with Elm
by mateuszf on Sunday July 26, 2015 @04:23PM
(#9952096)
Does it also have a diff mechanism and rerenders on "state" changes?
Re:Optimistic UI and Reactive Programming with Elm
by spuz on Sunday July 26, 2015 @04:26PM
(#9952103)
Yes see this post that explains how html works in Elm: http://elm-lang.org/blog/blazing-fast-html
Re:Optimistic UI and Reactive Programming with Elm
by vvanders on Sunday July 26, 2015 @04:19PM
(#9952085)
Thanks, that makes it a bit clearer. I really just need to spend some proper time with elm.
Re:Optimistic UI and Reactive Programming with Elm
by spuz on Sunday July 26, 2015 @04:24PM
(#9952100)
Also, I'd recommend reading the Elm Architecture Tutorial[0]. It shows how to separate your code into modules with view/model/update sections and how this separation naturally leads to composable components where parent-child relationships are created simply by delegating the view calls from parent module to child module.
It's not quite clear what you mean, the "view" function of a standard Elm application is a virtual dom, elm.html is implemented on top of the virtual-dom library[0]. If you mean component, as far as I understand in Elm you'd use separate models and sub-functions in separate modules for each concern ("component")[1]. Elm subscribes to the "single point of truth" philosophy[2] so there isn't really a sense of component-local state or lifecycle.
[0] https://github.com/Matt-Esch/virtual-dom
[1] https://gist.github.com/evancz/2b2ba366cae1887fe621#nesting
[2] like Om except more so