flowx-control: TypeScript Flow Control (Debounce, Throttle, RateLimit) for Modern Apps
Ever struggled with UI freezing on every keystroke or APIs getting hammered with duplicate calls? flowx-control solves exactly that. What is flowx-control? A zero-dependency TypeScript library that...

Source: DEV Community
Ever struggled with UI freezing on every keystroke or APIs getting hammered with duplicate calls? flowx-control solves exactly that. What is flowx-control? A zero-dependency TypeScript library that gives you precise control over function execution timing. Debounce, throttle, rate-limit, and more — all type-safe and tree-shakeable. npm install flowx-control bun add flowx-control Core Features Debounce Delay execution until after calls stop: import { debounce } from 'flowx-control'; const search = debounce(async (query: string) => { const results = await api.search(query); updateUI(results); }, 300); // Only fires 300ms after user stops typing input.addEventListener('input', (e) => search(e.target.value)); Throttle Limit execution to once per interval: import { throttle } from 'flowx-control'; const onScroll = throttle(() => { updateScrollPosition(); }, 100); window.addEventListener('scroll', onScroll); Rate Limit Control how many calls per time window: import { rateLimit } from