A lightweight Redux middleware for queuing actions when the app is offline and dispatching them once connectivity is restored. Version 1.1.2 provides a simple reducer, middleware, and utilities to mark actions for offline queuing. Designed for React Native, it works with redux-saga by suspending sagas during offline periods. Unlike alternatives like redux-offline, it focuses purely on offline queueing without integrated persistence or network detection, leaving those to be handled by the developer. The library ships TypeScript types and is stable, though low-maintenance.
npm install redux-offline-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Complete setup for redux-offline-queue: reducer, middleware, marking actions offline, and dispatching online/offline events.
Configure redux-persist to persist the 'offline' key or manually store the queue.
Apply middleware in order: offlineMiddleware, suspendSaga(sagaMiddleware), consumeActionMiddleware.
Import { ONLINE, OFFLINE } directly from 'redux-offline-queue'.Use NetInfo or navigator.onLine to detect connectivity and dispatch accordingly.
Add the reducer to combineReducers: offline: reducer from 'redux-offline-queue'.
Call markActionsOffline(creators, ['actionName']) and dispatch { type: OFFLINE } before dispatching the action.Apply suspendSaga(sagaMiddleware) and consumeActionMiddleware() in the correct order after offlineMiddleware.
No dependency data recorded yet.