diff --git a/2-ui/99-ui-misc/01-mutation-observer/article.md b/2-ui/99-ui-misc/01-mutation-observer/article.md index 3345a1bc..2a3f3790 100644 --- a/2-ui/99-ui-misc/01-mutation-observer/article.md +++ b/2-ui/99-ui-misc/01-mutation-observer/article.md @@ -243,14 +243,19 @@ When we stop the observing, it might be possible that some changes were not yet These methods can be used together, like this: ```js -// we'd like to stop tracking changes -observer.disconnect(); - -// handle unprocessed some mutations +// get a list of unprocessed mutations let mutationRecords = observer.takeRecords(); + +// stop tracking changes +observer.disconnect(); ... ``` + +```smart header="Records returned by `observer.takeRecords()` are removed from the processing queue" +The callback won't be called for records, returned by `observer.takeRecords()`. +``` + ```smart header="Garbage collection interaction" Observers use weak references to nodes internally. That is, if a node is removed from the DOM, and becomes unreachable, then it can be garbage collected.