Skip to content

Commit

Permalink
chore: update mutation utils
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Apr 25, 2022
1 parent 5643504 commit a1ea869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utilities/dom/src/mutation-observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function observeAttributes(node: Element | null, attributes: string | str
return () => obs.disconnect()
}

export function observeChildren(node: Element | null, fn: Callback, subtree = false) {
export function observeChildren(node: Element | null, fn: Callback) {
if (!node) return noop
const win = node.ownerDocument.defaultView || window
const obs = new win.MutationObserver((changes) => {
Expand All @@ -30,7 +30,7 @@ export function observeChildren(node: Element | null, fn: Callback, subtree = fa
}
})

obs.observe(node, { childList: true, subtree })
obs.observe(node, { childList: true, subtree: true })

return () => obs.disconnect()
}

0 comments on commit a1ea869

Please sign in to comment.