A quick update:
A)
Indeed, Lazy just checks for referential equality (is it the same
javascript object) and not "elm equality". This is kind of important to
know!
model !== { model | state = model.state}
B)
I think this might be a bug. I submitted an issue on
GH: https://github.com/elm-lang/virtual-dom/issues/62
Any thoughts?
Tom
On Friday, November 25, 2016 at 10:44:03 PM UTC+1, Tom wrote:
>
> I just posted a question, but it is not appearing on the elm-discuss page.
> If this is a duplicate non-the-less, my apologies.
>
> In short, I am rendering a dictionary like object into svg. Sometimes this
> happens every animation frame in order to get animations.
>
> A)
> Svg.Lazy doesn't seem to be working. It is calling the function even if
> the model isn't changing. I read somewhere that certain objects are never
> *referential* *equal* and therefore not suited for use with the lazy
> functions. Is this correct? What are the exact limitations of a model in
> order to use Svg.Lazy?
>
> B)
> When rendering the same model on every animation frame, I would expect the
> diffing functions from the virtual-dom to figure out that nothing in the
> dom needs to change. However, when I record a timeline profile in Chrome,
> it shows that every frame about 8ms is spent on diffing (updateIfNeeded)
> and 7ms on recalculating style. I would expect that the browser doesn't
> need to recalculate styles if nothing has changed? Are there limitations to
> the svg structures that the virtual dom can work with?
>
> Your thought are appreciated!
>
> Tom
>
>
>
>
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.