4 ms·
Interesting! When I check the DOM in inspector I can see it refreshing - maybe that's a bug?
by teh 12y ago
Interesting! When I check the DOM in inspector I can see it refreshing - maybe that's a bug?
- phamilton 12y agohttp://elm-lang.org/blog/Blazing-Fast-Html.elm http://elm-lang.org/blog/Blazing-Fast-Html.elm It's possible that only applies to HTML and not to canvas. If that's the case then I would hope the technique will be applied to canvas soon.
- jwmerrill 12y agoCanvas doesn't work that way. It's immediate mode, so unless you are doing something purely additive, you reissue all draw calls on every frame. Compare to SVG, which is retained mode.
- ramy_d 12y agoIs there a benefit to use ELM, aside from its functional properties, when using the canvas then? Does using SVG with ELM offer benefits over canvas with ELM?
- skybrian 12y agoHuh? A canvas element has a buffer and it will show the same frame as last time unless you clear and redraw it. If nothing has changed then it should be easy to skip the redraw.
- dandelany 12y ago> If nothing has changed That's the hard part. The virtual-dom takes care of this for you, but in the case of canvas, you'd have to determine whether or not anything actually changed, which involves keeping around a previous state and comparing it to the new state. It's certainly doable, but nowhere near as simple as using the virtual-DOM.