* Unsubscribes an observer from the mutation. * @internal * @param observer - The observer to remove. Garbage collection is scheduled afterwards.
(observer: MutationObserver<any, any, any, any>)
| 215 | * @param observer - The observer to remove. Garbage collection is scheduled afterwards. |
| 216 | */ |
| 217 | removeObserver(observer: MutationObserver<any, any, any, any>): void { |
| 218 | this.#observers = this.#observers.filter((x) => x !== observer) |
| 219 | |
| 220 | this.scheduleGc() |
| 221 | |
| 222 | this.#mutationCache.notify({ |
| 223 | type: 'observerRemoved', |
| 224 | mutation: this, |
| 225 | observer, |
| 226 | }) |
| 227 | } |
| 228 | |
| 229 | protected override optionalRemove() { |
| 230 | if (!this.#observers.length) { |