Observe changes to the DOM using an async iterable โ A nicer API for MutationObserver
by sindresorhusJavaScript
Last 12 weeks ยท 0 commits
4 of 6 standards met
Repository: sindresorhus/dom-mutations. Description: Observe changes to the DOM using an async iterable โ A nicer API for MutationObserver Stars: 224, Forks: 6. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v1.0.2 (5mo ago). Open PRs: 0, open issues: 0. Last activity: 5mo ago. Community health: 71%. Top contributors: sindresorhus, Richienb.
It turns out this problem happens for both functions, sorry! To fix this, we pass the signal down to the batched version, which will run the cleanup. This solution doesn't feel idiomatic, and that's because you're not intended to manually call . Rather, you implicitly call it when you do from within the loop, at which point a value would have needed to be produced so that the loop would run.