Closed paluh closed 4 years ago
MutationObservers run as part of the browser micro task queue, which is drained at the end of the current event loop tick. It’s similar to using requestAnimationFrame, but more prompt. It lets you batch renders in the case of multiple events firing due to bubbling. It’s unlikely that you need it for canvas.
Thanks!
P.S. Of course it was not necessary to fork spork. I'm using it as a library importing core primitives. I'm only providing my own App
type and related functions / types.
Once again thanks for creating Spork!
I want to use Spork fork (without vdom) as a state machine for
canvas
rendering and even for some "self contained" state machines not related directly to theDOM
. It seems really easy to dropvdom
fromSpork
and replace it with custom renderer but the last thing which I want to understand and is tight directly to the DOM is aSchduler
module which usesMutationObserver
.Could you please explain briefly what is the idea behind it and how it works?