From c1e7bcb0df0712c30ddf92832445c6a0e50cb27b Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sun, 13 Sep 2020 23:56:48 +0300 Subject: [PATCH] minor fixes --- 2-ui/99-ui-misc/01-mutation-observer/article.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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.