Closed copy closed 6 years ago
The documentations already mentions that physical equality is used:
(** Apply the function to generate a VDOM tree only if the function
or its argument have changed (physically) from the previous
synchronization.
Do you think some extra explanation would be useful?
Do you think some extra explanation would be useful?
Yes, I believe it would be useful to mention that physical equality fails for inline functions.
https://github.com/LexiFi/ocaml-vdom/commit/b76d7d2430fb5dad4647206c435520e82089dbaf
Let me know if you have something better!
Let me know if you have something better!
Sounds clear to me, thanks!
There's one edge-case of
Vdom.memo
that should be documented: It checks for physical equality (Javascript's===
) of the callback, so it doesn't work if the callback is written inline (i.e.memo (fun …)
). Took me some time to figure out.