Registry / web-framework / hideaway

hideaway

JSON →
library1.0.0jsnpmunverified

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 hideaway
INSTALL
IMPORT
SIG · HIDEAWAY
H
hideaway
web-frameworkjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

hideaway
import hideaway from 'hideaway'
const hideaway = require('hideaway')
Package is ESM-only; require() will fail. This is the default export, which is the middleware function.
stateManager
import { stateManager } from 'hideaway'
import { StateManager } from 'hideaway' (case-sensitivity)
Named export, lowercase. Used as a reducer to manage async state.
getValue
import { getValue } from 'hideaway'
import { generateSelector } from 'hideaway' (renamed in v0.2.0)
Renamed from generateSelector in v0.2.0; the old name is removed in v1.0.0.

Shows basic setup: wrapping root reducer with stateManager, applying hideaway middleware, and dispatching an API action.

import { createStore, applyMiddleware } from 'redux'; import hideaway from 'hideaway'; import { stateManager } from 'hideaway'; const initialState = {}; const rootReducer = (state = initialState, action) => state; const store = createStore( stateManager(rootReducer), applyMiddleware(hideaway) ); // To use with thunk-like API calls: store.dispatch({ type: 'FETCH_DATA', payload: { url: '/api/data' }, });
Debug
Known issues
breakinggenerateSelector renamed to getValue in v0.2.0. Old import will throw an error.
fix
Replace all imports of generateSelector with getValue.
affects: >=0.2.0
breakingonError signature changed in v0.2.3: now receives (action, response, getState, dispatch, onErrorApi, withExtraArgument). Old signature (action, error) will break.
fix
Update onError callback to handle the new parameters.
affects: >=0.2.3
deprecatedThe isNested option for stateManager was replaced by hasNested in v0.3.4. isNested may be removed in future versions.
fix
Use hasNested=true instead of isNested=true in state manager usage.
affects: >=0.3.4
breakingIn 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.
fix
Ensure any custom middleware or reducers that mutate action.type are compatible.
affects: >=0.2.2
gotchahideaway requires Redux v4 as a peer dependency. Using older Redux versions may cause runtime errors.
fix
Install redux@^4 or higher.
affects: >=1.0.0
gotchaThe default export hideaway() expects no arguments; passing arguments will throw an error.
fix
Call hideaway as a function with zero arguments in applyMiddleware.
affects: all
Errors
Common errors & fixes
Uncaught ReferenceError: require is not defined
Trying to use require() with an ESM-only package.
fix
Change to import statement or ensure your environment supports ESM.
TypeError: hideaway is not a function
Importing hideaway incorrectly (e.g., importing as named export instead of default).
fix
Use import hideaway from 'hideaway' (default import).
Module not found: Can't resolve 'hideaway'
Package not installed or wrong version.
fix
Run npm install hideaway and check package.json.
Error: Redux 'stateManager' reducer must not return undefined
stateManager is not applied correctly, or initial state is undefined.
fix
Ensure stateManager wraps your root reducer and initial state is defined.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
reduxrequiredPeer dependency; requires Redux v4 for middleware and store integration.
Agent activity
10 hits · last 30 days
node
10
Resources