observin
v1.0.0
Published
Modular SVG/DOM MutationObserver with event hooks and debounce support
Maintainers
Readme
observin
A modular and minimal DOM/SVG textContent observer with on/off/emit API and built-in debounce support.
Features
✅ Observe dynamic text updates
✅ Register custom callbacks with debounce
✅ Use it in vanilla JS or frameworks (React, Vue, etc.)
✅ Works with DOM and SVG elements
Usage
import { createObserver } from 'observin';
const observer = createObserver([
{ id: 'DownloadStatus', debounce: 250 },
{ id: 'UploadStatus' }
]);
observer.on('DownloadStatus', (val, prev) => {
console.log('📥 Download changed:', val);
});Browser version
<script src="dist/observer.min.js"></script>
<script>
const o = createObserver([{ id: "PingStatus" }]);
o.on("PingStatus", v => console.log("Ping:", v));
</script>License
MIT
