minor fixes
This commit is contained in:
parent
bd8e8a9bdd
commit
c1e7bcb0df
1 changed files with 9 additions and 4 deletions
|
@ -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:
|
These methods can be used together, like this:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
// we'd like to stop tracking changes
|
// get a list of unprocessed mutations
|
||||||
observer.disconnect();
|
|
||||||
|
|
||||||
// handle unprocessed some mutations
|
|
||||||
let mutationRecords = observer.takeRecords();
|
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"
|
```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.
|
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.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue