Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
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"]}