Registry / testing / redux-rest-resource

redux-rest-resource

JSON →
library0.29.3jsnpmunverified

Redux Rest Resource (v0.29.3) generates Redux types, actions, and reducers for REST API interactions. It reduces boilerplate by automatically creating CRUD operations from a simple resource definition. Requires redux-thunk for async actions and a fetch polyfill for environments without native fetch. Ships TypeScript types. Released in 2016 and currently in maintenance mode with no major updates since 2018. Alternatives include redux-query and RTK Query.

npm install redux-rest-resource
INSTALL
IMPORT
SIG · REDUX-REST-RESOURC
R
redux-rest-resource
testingjavascriptv0.29.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

createResource
import { createResource } from 'redux-rest-resource'
const createResource = require('redux-rest-resource').createResource
Library supports both ESM and CJS, but TypeScript types are only correct with ESM import.
types
import { types } from 'redux-rest-resource'
types is a named export alongside createResource.
actions
import { actions } from 'redux-rest-resource'
actions is also a named export, not a default export.

Shows how to define a resource with TypeScript generic and get generated types, actions, and reducers.

import { createResource } from 'redux-rest-resource'; const hostUrl = 'https://api.mlab.com:443/api/1/databases/sandbox/collections'; const apiKey = process.env.API_KEY ?? ''; type User = { id: string; firstName: string; lastName: string; }; export const { types, actions, rootReducer } = createResource<User>({ name: 'user', url: `${hostUrl}/users/:id?apiKey=${apiKey}` });
Debug
Known issues
deprecatedLibrary is in maintenance mode; no new features since 2018.
fix
Consider migrating to a more modern alternative like RTK Query or redux-query.
affects: >=0.0.0
breakingRequires redux-thunk as a peer dependency; missing it causes runtime errors.
fix
Install redux-thunk: npm install redux-thunk
affects: >=0.0.0
gotchaUses fetch API; fails in older browsers without polyfill.
fix
Add a fetch polyfill like 'whatwg-fetch' for older browsers.
affects: >=0.0.0
breakingTypeScript generic type must match the response shape; mismatch causes silent errors.
fix
Ensure the generic type exactly matches the API response structure.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'redux-thunk'
Missing peer dependency redux-thunk.
fix
Run: npm install redux-thunk
TypeError: Cannot read property 'actions' of undefined
Default import used instead of named import.
fix
Use: import { createResource } from 'redux-rest-resource'
fetch is not defined
Environment lacks fetch API (e.g., older Node.js or browser).
fix
Install a fetch polyfill: npm install whatwg-fetch and import it.
Upgrade
Version history
0.29.3latest on npm
Audit
Dependencies
redux-thunkrequiredRequired for async action handling
Agent activity
10 hits · last 30 days
node
10
Resources
redux-rest-resource — npm install redux-rest-resource · libregistry