This is a simple method for supporting offline sync. When two way concurrency such as scuttlebutt/CRDT is not possible (e.g. third party api's) or is not desired (complexity), this is a simple alternative.
The basic concept is, try to execute the action, on failure add it to a retry queue. Every so often process the retry queue until success is achieved.
Setup
import{owlReducer,enableOwl}from'redux-owl'
import{persistStore}from'redux-persist'
constreducer=combineReducers({
...otherReducers,
owl: owlReducer,
})
//...
persistStore(store,{},(err)=>{
//does not depend on redux-persist, but be sure enable owl