Comparing version 0.0.4 to 0.0.5
@@ -1,2 +0,2 @@ | ||
(function(n,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(n=typeof globalThis<"u"?globalThis:n||self,n.winkblue=r())})(this,function(){"use strict";const n=Object.create(null);return{on:function(t,o){const e=new WeakSet,f=new MutationObserver(()=>{for(const i of Array.from(document.querySelectorAll(t)))if(i&&!e.has(i))return e.add(i),o(i)});f.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),n[t]||(n[t]=new Set),n[t].add({cb:o,mo:f})},off:function(t,o){const e=n[t];if(e)if(o){const f=Array.from(e).find(i=>i.cb===o);f.mo.disconnect(),e.delete(f)}else for(const f of e)f.mo.disconnect(),e.delete(f)},reset:function(){for(const t of Object.keys(n)){const o=n[t];for(const e of o)e.mo.disconnect(),o.delete(e)}}}}); | ||
(function(n,r){typeof exports=="object"&&typeof module<"u"?module.exports=r():typeof define=="function"&&define.amd?define(r):(n=typeof globalThis<"u"?globalThis:n||self,n.winkblue=r())})(this,function(){"use strict";const n=Object.create(null);return{on:function(t,o){const e=new WeakSet,f=new MutationObserver(()=>{for(const i of Array.from(document.querySelectorAll(t)))if(i&&!e.has(i))return e.add(i),setTimeout(()=>o(i),0)});f.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0}),n[t]||(n[t]=new Set),n[t].add({cb:o,mo:f})},off:function(t,o){const e=n[t];if(e)if(o){const f=Array.from(e).find(i=>i.cb===o);f.mo.disconnect(),e.delete(f)}else for(const f of e)f.mo.disconnect(),e.delete(f)},reset:function(){for(const t of Object.keys(n)){const o=n[t];for(const e of o)e.mo.disconnect(),o.delete(e)}}}}); | ||
//# sourceMappingURL=winkblue.umd.js.map |
{ | ||
"name": "winkblue", | ||
"type": "module", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "author": "FlandreDaisuki <vbnm123c+github@gmail.com>", |
# winkblue | ||
[![NPM Version](https://img.shields.io/npm/v/winkblue)](https://www.npmjs.com/package/winkblue) | ||
An DOM element detector which API compatible to [sentinel-js](https://github.com/muicss/sentineljs) | ||
@@ -9,5 +11,13 @@ | ||
2. sentinel-js can not trigger multiple times if multiple selectors match the same element. | ||
3. sentinel-js can not work with multiple instances. | ||
## playground | ||
1. [simple usage](https://flandredaisuki.github.io/winkblue/play/simple) | ||
2. [hidden elements](https://flandredaisuki.github.io/winkblue/play/hidden) | ||
3. [fizzbuzz](https://flandredaisuki.github.io/winkblue/play/fizzbuzz) | ||
4. [multiple instance](https://flandredaisuki.github.io/winkblue/play/multi-instance) | ||
## LICENSE | ||
[ISC](LICENSE) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9085
23