Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
redux-offline-chain
Advanced tools
A redux-middleware for redux-offline, inspired by redux-thunk.
redux-offline-chain allows you to chain offline actions. It looks for action.meta.then functions and invokes them in a redux-thunk like manner. The then callback gets the payload from the effect reconciler and optionally redux's dispatch and getState functions.
Caveat: Please note that the functions cannot be persisted and therefore only work within the same session.
$ npm install --save redux-offline-chain
import { applyMiddleware, compose, createStore, Store } from 'redux'
import { offline } from 'redux-offline'
import offlineConfig from 'redux-offline/lib/defaults'
import offlineChain from 'redux-offline-chain'
const store = offline(offlineConfig)(createStore)(
rootReducer,
compose(applyMiddleware(offlineChain))
)
type OfflineAction = {
type: string,
payload: any,
meta: {
offline: {
effect: any,
rollback: Action
commit: {
type: string,
meta: {
+ then: Function,
},
},
},
}
}
export const actionCreator = payload => ({
type: 'SOME_ACTION,'
payload,
meta: {
offline: {
effect: { path: '/some/endpoint' },
rollback: { type: 'SOME_ACTION_ROLLBACK' },
commit: {
type: 'SOME_ACTION_COMMIT',
meta: {
then: payload => ({
type: 'ANOTHER_ACTION',
payload,
meta: {
offline: {
effect: { path: '/another/endpoint', method: 'POST' },
rollback: { type: 'ANOTHER_ACTION_ROLLBACK' },
commit: {
type: 'ANOTHER_ACTION_COMMIT',
meta: {
then: payload => (dispatch, getState) => {
// ....
},
}
},
},
},
}),
},
},
},
},
})
FAQs
chain as many offline actions as you like
The npm package redux-offline-chain receives a total of 6 weekly downloads. As such, redux-offline-chain popularity was classified as not popular.
We found that redux-offline-chain demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.