@zag-js/dom-utils
Advanced tools
Comparing version 0.0.0-dev-20220710093812 to 0.0.0-dev-20220710102425
@@ -515,9 +515,3 @@ "use strict"; | ||
const win = node.ownerDocument.defaultView || window; | ||
const obs = new win.MutationObserver((changes) => { | ||
for (const change of changes) { | ||
if (change.type === "childList") { | ||
fn(change); | ||
} | ||
} | ||
}); | ||
const obs = new win.MutationObserver(fn); | ||
obs.observe(node, { childList: true, subtree: true }); | ||
@@ -524,0 +518,0 @@ return () => obs.disconnect(); |
declare type Callback = (v: MutationRecord) => void; | ||
export declare function observeAttributes(node: Element | null, attributes: string | string[], fn: Callback): () => void; | ||
export declare function observeChildren(node: Element | null, fn: Callback): () => void; | ||
export declare function observeChildren(node: Element | null, fn: (v: MutationRecord[]) => void): () => void; | ||
export {}; |
{ | ||
"name": "@zag-js/dom-utils", | ||
"version": "0.0.0-dev-20220710093812", | ||
"version": "0.0.0-dev-20220710102425", | ||
"description": "", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/types": "0.0.0-dev-20220710093812", | ||
"@zag-js/types": "0.0.0-dev-20220710102425", | ||
"@zag-js/utils": "0.1.2" | ||
@@ -31,0 +31,0 @@ }, |
Sorry, the diff of this file is not supported yet
90284
2599
+ Added@zag-js/types@0.0.0-dev-20220710102425(transitive)
- Removed@zag-js/types@0.0.0-dev-20220710093812(transitive)