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).
npm install hideawayVerified import paths — ran on the pinned version, not inferred.
Shows basic setup: wrapping root reducer with stateManager, applying hideaway middleware, and dispatching an API action.
Replace all imports of generateSelector with getValue.
Update onError callback to handle the new parameters.
Use hasNested=true instead of isNested=true in state manager usage.
Ensure any custom middleware or reducers that mutate action.type are compatible.
Install redux@^4 or higher.
Call hideaway as a function with zero arguments in applyMiddleware.
Change to import statement or ensure your environment supports ESM.
Use import hideaway from 'hideaway' (default import).
Run npm install hideaway and check package.json.
Ensure stateManager wraps your root reducer and initial state is defined.