{"id":18418,"library":"hideaway","title":"Hideaway Redux Middleware","description":"Hideaway is a Redux middleware (v1.0.0) that streamlines API calls and state management by reducing boilerplate for reducers, selectors, and thunks. It provides a state manager for handling loading/error/data states, supports nested paths, and includes an apiPreReducer hook. Compared to redux-toolkit, it offers a more opinionated approach focused on async actions and automatic state shape generation. The package is ESM-only, ships TypeScript types, and requires Redux 4. Recent releases (0.2.x-0.3.x) introduced breaking changes to the API (e.g., renamed methods, new signatures for onError, generateSelector→getValue).","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/Ozahata/hideaway","tags":["javascript","react","react-redux","redux","thunk","hideaway","middleware","redux-middleware","flux","typescript"],"install":[{"cmd":"npm install hideaway","lang":"bash","label":"npm"},{"cmd":"yarn add hideaway","lang":"bash","label":"yarn"},{"cmd":"pnpm add hideaway","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; requires Redux v4 for middleware and store integration.","package":"redux","optional":false}],"imports":[{"note":"Package is ESM-only; require() will fail. This is the default export, which is the middleware function.","wrong":"const hideaway = require('hideaway')","symbol":"hideaway","correct":"import hideaway from 'hideaway'"},{"note":"Named export, lowercase. Used as a reducer to manage async state.","wrong":"import { StateManager } from 'hideaway' (case-sensitivity)","symbol":"stateManager","correct":"import { stateManager } from 'hideaway'"},{"note":"Renamed from generateSelector in v0.2.0; the old name is removed in v1.0.0.","wrong":"import { generateSelector } from 'hideaway' (renamed in v0.2.0)","symbol":"getValue","correct":"import { getValue } from 'hideaway'"}],"quickstart":{"code":"import { createStore, applyMiddleware } from 'redux';\nimport hideaway from 'hideaway';\nimport { stateManager } from 'hideaway';\n\nconst initialState = {};\nconst rootReducer = (state = initialState, action) => state;\n\nconst store = createStore(\n  stateManager(rootReducer),\n  applyMiddleware(hideaway)\n);\n\n// To use with thunk-like API calls:\nstore.dispatch({\n  type: 'FETCH_DATA',\n  payload: { url: '/api/data' },\n});","lang":"javascript","description":"Shows basic setup: wrapping root reducer with stateManager, applying hideaway middleware, and dispatching an API action."},"warnings":[{"fix":"Replace all imports of generateSelector with getValue.","message":"generateSelector renamed to getValue in v0.2.0. Old import will throw an error.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Update onError callback to handle the new parameters.","message":"onError signature changed in v0.2.3: now receives (action, response, getState, dispatch, onErrorApi, withExtraArgument). Old signature (action, error) will break.","severity":"breaking","affected_versions":">=0.2.3"},{"fix":"Use hasNested=true instead of isNested=true in state manager usage.","message":"The isNested option for stateManager was replaced by hasNested in v0.3.4. isNested may be removed in future versions.","severity":"deprecated","affected_versions":">=0.3.4"},{"fix":"Ensure any custom middleware or reducers that mutate action.type are compatible.","message":"In v0.2.2, the middleware now adds a 'type' property to the action object root, which may conflict with existing code that expects action.type to be the only type field.","severity":"breaking","affected_versions":">=0.2.2"},{"fix":"Install redux@^4 or higher.","message":"hideaway requires Redux v4 as a peer dependency. Using older Redux versions may cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Call hideaway as a function with zero arguments in applyMiddleware.","message":"The default export hideaway() expects no arguments; passing arguments will throw an error.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Change to import statement or ensure your environment supports ESM.","cause":"Trying to use require() with an ESM-only package.","error":"Uncaught ReferenceError: require is not defined"},{"fix":"Use import hideaway from 'hideaway' (default import).","cause":"Importing hideaway incorrectly (e.g., importing as named export instead of default).","error":"TypeError: hideaway is not a function"},{"fix":"Run npm install hideaway and check package.json.","cause":"Package not installed or wrong version.","error":"Module not found: Can't resolve 'hideaway'"},{"fix":"Ensure stateManager wraps your root reducer and initial state is defined.","cause":"stateManager is not applied correctly, or initial state is undefined.","error":"Error: Redux 'stateManager' reducer must not return undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}