#events 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 Debounce
Delays invoking a function until after a specified wait time has elapsed since the last time it was called. Essential for search inputs, resize handlers, and any event that fires rapidly — prevents excessive function calls and improves performance.
JavaScript Throttle
Ensures a function is called at most once per specified time interval, no matter how many times the trigger fires. Ideal for scroll listeners, mousemove handlers, and window resize events where you need regular updates but not every single frame.
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 Delegate Event Listener
Attaches a single event listener to a parent element and handles events from matching descendant elements via event delegation. More efficient than attaching listeners to many individual elements, and works for elements added dynamically to the DOM after the listener is registered.