All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.DOMObserver.js.map Maven / Gradle / Ivy

{"version":3,"file":"DOMObserver.js","sourceRoot":"","sources":["../src/DOMObserver.ts"],"names":[],"mappings":"AAAA,MAAM,SAAS,GAAG,IAAI,OAAO,EAA0B,CAAC;AAExD;;;;GAIG;AACH,MAAM,cAAc,GAAG,CAAC,IAAU,EAAE,QAA0B,EAAE,OAA8B,EAAE,EAAE;IACjG,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAChD,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACjC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,gBAAgB,GAAG,CAAC,IAAU,EAAE,EAAE;IACvC,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,QAAQ,EAAE;QACb,QAAQ,CAAC,UAAU,EAAE,CAAC;QACtB,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KACvB;AACF,CAAC,CAAC;AAEF,OAAO,EACN,cAAc,EACd,gBAAgB,GAChB,CAAC","sourcesContent":["const observers = new WeakMap();\n\n/**\n * @param node\n * @param callback\n * @param options\n */\nconst observeDOMNode = (node: Node, callback: MutationCallback, options?: MutationObserverInit) => {\n\tconst observer = new MutationObserver(callback);\n\tobservers.set(node, observer);\n\tobserver.observe(node, options);\n};\n\n/**\n * @param node\n */\nconst unobserveDOMNode = (node: Node) => {\n\tconst observer = observers.get(node);\n\tif (observer) {\n\t\tobserver.disconnect();\n\t\tobservers.delete(node);\n\t}\n};\n\nexport {\n\tobserveDOMNode,\n\tunobserveDOMNode,\n};\n"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy