Offline-first client-side task queue for persisting, retrying, and replaying async tasks. Current stable version is 0.4.0. Under active development with frequent bug fixes and feature additions. Key differentiator: designed specifically for React Native and browser environments, leveraging local storage or custom backends for persistence. Heavily typed with TypeScript-first API.
npm install later-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an offline queue that stores tasks in localStorage, adds a fetch task with retry, and starts processing.
Explicitly set storage: 'memory' in createQueue options if you need in-memory storage.
Always call queue.start() after adding initial tasks, or set autoStart: true in options.
Replace retryOn with retryCondition in queue options.
Pass a storage adapter object with getItem, setItem, removeItem methods, e.g., using @react-native-async-storage/async-storage.
Provide a valid storage adapter in createQueue({ storage: customAdapter }) or use a polyfill for localStorage.Check task logic for errors, increase maxRetries, or handle failed tasks via queue.on('taskFailed', callback).Wrap your async operation in a function: queue.add(async () => { ... }).Call queue.start() immediately after adding tasks, or set autoStart: true in createQueue options.