{"id":18731,"library":"redux-sequence-action","title":"redux-sequence-action","description":"A Redux middleware that enables sequential dispatch of actions using arrays and nested arrays, providing a declarative syntax for ordered action execution. Version 0.2.1, stable but unmaintained since 2016. It simplifies dispatching sequences like A → [B, C] → D → E without needing thunk or promise middleware. Differentiates from redux-saga or redux-observable by being a lightweight, pure middleware approach with no additional dependencies.","status":"maintenance","version":"0.2.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/jasonslyvia/redux-sequence-action","tags":["javascript","redux","redux-middleware","middleware","flux"],"install":[{"cmd":"npm install redux-sequence-action","lang":"bash","label":"npm"},{"cmd":"yarn add redux-sequence-action","lang":"bash","label":"yarn"},{"cmd":"pnpm add redux-sequence-action","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export; named import will fail.","wrong":"import { sequenceAction } from 'redux-sequence-action'","symbol":"sequenceAction","correct":"import sequenceAction from 'redux-sequence-action'"},{"note":"applyMiddleware is from redux, not this package.","wrong":"import { applyMiddleware, createStore } from 'redux-sequence-action'","symbol":"applyMiddleware","correct":"import { applyMiddleware, createStore } from 'redux'"},{"note":"dispatch takes an array of actions to sequence, not multiple arguments.","wrong":"dispatch(A, B, C, D, E)","symbol":"dispatch","correct":"dispatch([A, [B, C], D, E])"}],"quickstart":{"code":"import { createStore, applyMiddleware } from 'redux';\nimport sequenceAction from 'redux-sequence-action';\n\nconst reducer = (state = { count: 0 }, action) => {\n  switch (action.type) {\n    case 'INC': return { ...state, count: state.count + 1 };\n    case 'DEC': return { ...state, count: state.count - 1 };\n    default: return state;\n  }\n};\n\nconst store = createStore(reducer, applyMiddleware(sequenceAction));\n\nstore.dispatch([\n  { type: 'INC' },\n  (dispatch, getState) => {\n    console.log('After INC:', getState().count); // 1\n    dispatch({ type: 'DEC' });\n  }\n]);\n\nconsole.log(store.getState().count); // 0","lang":"javascript","description":"Demonstrates sequential dispatch: first a sync action, then a function with dispatch and getState, resulting in state changes in order."},"warnings":[{"fix":"Ensure action creators return arrays or define a fallback for single actions.","message":"Action creators must return an array of actions or thunks; returning a plain object will cause middleware to pass it through unhandled, potentially breaking the sequence.","severity":"gotcha","affected_versions":"*"},{"fix":"Consider using redux-thunk with promise chains or redux-saga for sequence control.","message":"Package is unmaintained since 2016; no compatibility with modern Redux (v4+) or TypeScript types.","severity":"deprecated","affected_versions":"*"},{"fix":"Use Promise.all or a different middleware like redux-promise for true parallel dispatch.","message":"When using nested arrays for parallel actions, the middleware does not actually run them in parallel; it dispatches sequentially in order, ignoring the array nesting semantics as parallel.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure sequenceAction is the last middleware in applyMiddleware chain to avoid middleware skipping.","message":"The function action (thunk) inside the array receives (dispatch, getState) but the dispatch provided by the middleware is the store's raw dispatch, which does not pass through other middlewares unless applied after in chain.","severity":"breaking","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Add sequenceAction to applyMiddleware: applyMiddleware(sequenceAction).","cause":"Dispatching an array action without the sequenceAction middleware.","error":"Uncaught Error: Actions must be plain objects. Use custom middleware for async actions."},{"fix":"Ensure the outer dispatch is from a store that has sequenceAction middleware, and use the pattern dispatch([...]).","cause":"Trying to dispatch an array inside a thunk that was not created by this middleware.","error":"TypeError: dispatch is not a function"},{"fix":"Check all elements in the array returned by action creator to ensure they are valid actions or thunks.","cause":"An element in the action array is undefined or null.","error":"Cannot read property 'type' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}