#observer Clear
Tags #utils #browser #performance #array #async #dom #objects #pattern #events #format #concurrency #http #ui #advanced #fetch #url #string #functional #cache #files #crypto #promise #intl #observer
JavaScript Event Emitter (Pub/Sub)
A lightweight publish/subscribe event system. Listeners register with on(), fire once with once(), are removed with off(), and events are dispatched with emit(). Useful for decoupling modules, building plugin systems, and implementing the Observer pattern without a framework dependency.
JavaScript Intersection Observer (Lazy Load / Reveal)
Uses the IntersectionObserver API to trigger a callback when elements enter the viewport. The reveal pattern adds a visible class to animate elements as they scroll into view. The lazyLoad pattern loads images on demand by swapping data-src to src. Much more performant than scroll event listeners.