MutationObserver Playground

Rara changes #target, Bagas writes a slip for every change the observe() options cover, and the teacher reads the stack. When, and how many slips at a time?…

Why it matters

Before MutationObserver people used polling (setInterval) or the deprecated, slow mutation events. Now: async, bundled, cheap. It is used to spot content another library inserts, in rich text editors, to sync state, and to auto-init components that show up later.

The key idea

One callback per microtask, not one per change

Common mistakes

Try it in this playground