0.0.6 • Published 3 months ago
winkblue v0.0.6
winkblue
An DOM element detector which API compatible to sentinel-js
Installation
CDN
<script src="https://unpkg.com/winkblue@0.0.5/dist/winkblue.umd.js"></script>
CDN + ESM
<script type="importmap">
{
"imports": {
"winkblue": "https://esm.sh/winkblue"
}
}
</script>
<script type="module">
import winkblue from 'winkblue';
</script>
Usage
winkblue.on('.dynamic-load-components', (el) => {
// do something on `el`
});
Why?
- sentinel-js can not find the
display: none;
elements. - sentinel-js can not trigger multiple times if multiple selectors match the same element.
- sentinel-js can not work with multiple instances.
Limitation
- if you reuse the same element instance, the callback will not be triggered.