Skip to content

Commit c1e7bcb

Browse files
committed
minor fixes
1 parent bd8e8a9 commit c1e7bcb

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

2-ui/99-ui-misc/01-mutation-observer/article.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,14 +243,19 @@ When we stop the observing, it might be possible that some changes were not yet
243243
These methods can be used together, like this:
244244

245245
```js
246-
// we'd like to stop tracking changes
247-
observer.disconnect();
248-
249-
// handle unprocessed some mutations
246+
// get a list of unprocessed mutations
250247
let mutationRecords = observer.takeRecords();
248+
249+
// stop tracking changes
250+
observer.disconnect();
251251
...
252252
```
253253

254+
255+
```smart header="Records returned by `observer.takeRecords()` are removed from the processing queue"
256+
The callback won't be called for records, returned by `observer.takeRecords()`.
257+
```
258+
254259
```smart header="Garbage collection interaction"
255260
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.
256261

0 commit comments

Comments
 (0)