Registry / testing / redux-rest-helper-for-loopback

redux-rest-helper-for-loopback

JSON →
library0.3.5jsnpmunverified

A Redux utility to automate creation of REST actions and reducers specifically for LoopBack APIs. Version 0.3.5, no recent updates since 2019. It integrates with redux-thunk, react-redux, axios, and randomstring. Differentiators: automatic resource name mapping for LoopBack endpoints, built-in error handling via push/notifError callbacks, and TypeScript support. However, it's not actively maintained and may lack modern Redux best practices.

npm install redux-rest-helper-for-loopback
INSTALL
IMPORT
SIG · REDUX-REST-HELPER-
R
redux-rest-helper-for-loopback
testingjavascriptv0.3.5
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.

actionCreator
import { actionCreator } from 'redux-rest-helper-for-loopback'
const actionCreator = require('redux-rest-helper-for-loopback').actionCreator
ESM default export is not used; named import is correct. CommonJS require also works but named import preferred.
reducerCreator
import { reducerCreator } from 'redux-rest-helper-for-loopback'
import reducerCreator from 'redux-rest-helper-for-loopback'
This is a named export, not default export.
requestCreator
import { requestCreator } from 'redux-rest-helper-for-loopback'
Used with actionCreator to define API paths.

Shows how to create actions and reducer for a resource named 'TEST' with an empty path, push/notifError stubs, and dispatch getAll action.

import { actionCreator, reducerCreator, requestCreator } from 'redux-rest-helper-for-loopback'; import axios from 'axios'; import { createStore, applyMiddleware } from 'redux'; import thunk from 'redux-thunk'; import { combineReducers } from 'redux'; const push = (path) => ({}); // dummy const notifError = (msg) => ({ type: 'NOTIF_ERROR', payload: msg }); const actions = actionCreator('TEST', requestCreator('/'), push, notifError); const red = reducerCreator('TEST', { name: '' }); const rootReducer = combineReducers({ test: red.getReducer() }); const store = createStore(rootReducer, applyMiddleware(thunk)); store.dispatch(actions.getAll());
Debug
Known issues
deprecatedPackage has not been updated since 2019 and may not work with newer versions of Redux, react-redux, or axios.
fix
Consider migrating to Redux Toolkit and React Query for modern REST handling.
affects: >=0.3.0
gotchaactionCreator expects 'push' and 'notifError' functions but does not validate them; passing incorrect arguments leads to silent failures.
fix
Ensure push is a function that returns a Redux action for navigation, and notifError dispatches an error notification.
affects: all
gotchareducerCreator returns an object with getReducer method; forgetting to call getReducer() will break Redux store.
fix
Always use `red.getReducer()` when adding to combineReducers.
affects: all
breakingaxios is a peer dependency; missing it causes runtime errors.
fix
Run npx install-peerdeps redux-rest-helper-for-loopback or manually install peer deps.
affects: all
Errors
Common errors & fixes
TypeError: _this.props.dispatch is not a function
Redux store not properly connected to React components via react-redux Provider.
fix
Wrap your app with <Provider store={store}> and ensure connected components receive dispatch via connect or hooks.
Error: Actions must be plain objects. Use custom middleware for async actions.
Missing redux-thunk middleware or incorrect action creator usage.
fix
Apply thunk middleware: createStore(rootReducer, applyMiddleware(thunk))
Cannot read property 'getReducer' of undefined
reducerCreator called without arguments or with invalid resource name.
fix
Ensure first argument to reducerCreator is a non-empty string matching the resource name used in actionCreator.
Upgrade
Version history
0.3.5latest on npm
Audit
Dependencies
redux-thunkrequiredRequired for async action creators
react-reduxrequiredRequired for connecting React components
axiosrequiredUsed for HTTP requests
randomstringrequiredUsed for generating unique IDs
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
redux-rest-helper-for-loopback — npm install redux-rest-helper-for-loopback · libregistry