Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Dec 17, 2024
1 parent e25ddbd commit ae55158
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export class MutationObservable {
private settings: MutationObservableSettings
// Track observed elements to avoid duplicate observers
// WeakSet is used here to allow garbage collection of elements that are no longer in the DOM
private observedElements = new WeakSet()
private observedElements = new WeakSet<HTMLElement>()
private prevMutationsCache = new WeakMap<HTMLElement, AttributeMutations>()
private emitter = new ElementChangedEmitter()
private listeners = new Set<MutationObservableSubscriber>()
Expand Down Expand Up @@ -296,7 +296,7 @@ export class MutationObservable {
allElementSelectors.forEach((selector) => {
const elements = document.querySelectorAll(selector)
elements.forEach((element) => {
if (this.observedElements.has(element)) {
if (this.observedElements.has(element as HTMLElement)) {
return
}
logger.debug('Observing element', element)
Expand Down

0 comments on commit ae55158

Please sign in to comment.