{"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,"search_vec":"'-0.3':79 '0.2':77 '4':74 'action':56 'api':12,86 'apiprereduc':40 'approach':52 'async':55 'automat':58 'boilerpl':19 'break':82 'call':13 'chang':83 'compar':42 'e.g':87 'esm':66 'esm-on':65 'flux':108 'focus':53 'generat':61 'generateselector':94 'getvalu':95 'handl':31 'hideaway':1,4,103 'hook':41 'includ':38 'introduc':81 'javascript':96 'loading/error/data':32 'manag':16,29 'method':89 'middlewar':3,8,104,107 'nest':35 'new':90 'offer':48 'onerror':93 'opinion':51 'packag':63 'path':36 'provid':26 'react':97,99 'react-redux':98 'recent':75 'reduc':18,21 'redux':2,7,45,73,100,101,106 'redux-middlewar':105 'redux-toolkit':44 'releas':76 'renam':88 'requir':72 'selector':22 'shape':60 'ship':68 'signatur':91 'state':15,28,33,59 'streamlin':11 'support':34 'thunk':24,102 'toolkit':46 'type':70 'typescript':69,109 'v1.0.0':9 'x':78,80","created_at":"2026-04-25T07:38:07.678304+00:00","updated_at":"2026-04-25T07:38:07.678304+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Ozahata/hideaway","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/hideaway","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}