prioriq
v1.1.0
Published
A lightweight, extensible task scheduling system for React apps with concurrency, deduplication, timeout, and middleware support.
Maintainers
Readme
🧠 prioriq
Intelligent async task coordination for React apps — with queues, debouncing, deduplication, idle handling, and more.
📦 Install
npm install prioriq🚀 Features
- ⏳ Delay & debounce (per task)
- 🧠 Deduplication with
dedupeKey - 🧩 Express-like middleware
- ⏱ Timeout,
requestIdleCallback, abort/cancel - 🔄 Circuit breaker & error cooldowns
- 🔍 React hook integration + devtools-ready
🛠 Quick Example
const scheduler = new TaskScheduler();
scheduler.addQueue("visits", 3);
scheduler.request({
id: "v123",
task: () => fetchVisit(123),
delay: 200,
dedupeKey: "visit:123",
});🧩 React Integration
const { queued, running, pending } = useTaskScheduler(scheduler, "visits");
scheduleWhenVisible(
entry?.isIntersecting,
"visits",
id,
() => fetchVisit(id),
scheduler
);📚 Documentation
Or explore
/docs/folder for GitHub Pages setup.
🧪 Test & Build
npm run build
npm test
npm run release # via standard-version🔗 Related Tools
📜 License
MIT — Use freely, modify responsibly.
