
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
jsonapi-redux-data
Advanced tools
JsonApi Redux data is a one stop shop for all your api needs! Provides methods to make your API call as well as updates the redux store with the data received from the backend.

Provides methods to make api calls to your JSONApi compliant backend and updates the redux store as well.
Combines the data so it is easily accessible
Setup in 3 easy steps
Update the reducers / rootReducers like this
...
import { jsonApiReducer } from 'jsonapi-redux-data'
...
const rootReducer = combineReducers({
...,
api: jsonApiReducer,
...
})
...
Create the api client preferrably in the app.js
...
import { createApiClientWithTransform } from 'jsonapi-redux-data'
...
// Create redux store with history
const initialState = {};
const store = configureStore(initialState, history);
...
createApiClientWithTransform('<base-url>', store)
...
Make api call easily and from anywhere
...
import { getApi } from 'jsonapi-redux-data'
...
getApi({ pathname: '<pathname>', include: '<include-string>' })
...
getApi({
pathname: 'tasks',
includes: 'lists',
levelOfNesting: 3
});
Invoking this method will
base-url/tasksSUCCESS_APIMake a get request and add api response to the redux store.
/**
* @param {} requestPayload: {
* include: object
* filter: object,
* pathname: String,
* levelOfNesting: number,
* transformList: object,
* id: String
* }
* @param {} api: Custom Api Client instead of the latest created api client
* @param {} axios: Special axios config
**/
function getApi (requestPayload, api, axiosConfig)
Make a post request and add api response to the redux store
/**
* @param {} requestPayload: {
* include: object
* filter: object,
* pathname: String,
* levelOfNesting: number,
* transformList: object,
* postData: object
* }
* @param {} api: Custom Api Client instead of the latest created api client
* @param {} axios: Special axios config
*/
function postApi (requestPayload, api, axiosConfig)
Make a patch request and add api response to the redux store
/**
*
* @param {} requestPayload: {
* include: object
* filter: object,
* pathname: String,
* levelOfNesting: number,
* transformList: object,
* patchData: object
* }
* @param {} api: Custom Api Client instead of the latest created api client
* @param {} axios: Special axios config
*
* */
function patchApi (requestPayload, api, axios)
Make a delete request and add api response to the redux store
/**
*
* @param {} requestPayload: {
* pathname: String,
* id: String
* }
* @param {} api: Custom Api Client instead of the latest created api client
* @param {} axios: Special axios config
*
* */
function deleteApi (requestPayload, api, axios)
GET HTTP REQUEST, uses the apisauce.get underneath the hood.
/**
* @param {} pathname: the endpoint path
* @param {} include: the jsonapi include string
* @param {} filter: the jsonapi filter string
* @param {} id: the id of the GET request.
* @param {} api: default is getLatestApiClient()
* @param {} axiosConfig: custom axiosConfig for this request
*/
function getRequest (pathname, include, filter, id, api, axiosConfig)
POST HTTP REQUEST, uses the apisauce.get underneath the hood.
/**
*
* @param {} pathname: the endpoint path
* @param {} include: the jsonapi include string
* @param {} filter: the jsonapi filter string
* @param {} postData: request body
* @param {} api: default is getLatestApiClient()
* @param {} axiosConfig: custom axiosConfig for this request
*/
function postRequest (pathname, include, filter, postData, api, axiosConfig)
PATCH HTTP REQUEST, uses the apisauce.get underneath the hood.
/**
* @param {} pathname
* @param {} include: the jsonapi include string
* @param {} filter: the jsonapi filter string
* @param {} id: the id of the PATCH request.
* @param {} patchData: request body
* @param {} api: default is getLatestApiClient()
* @param {} axiosConfig: custom axiosConfig for this request
*/
function patchRequest (pathname, include, filter, id, patchData, api,axiosConfig)
DELETE HTTP REQUEST, uses the apisauce.get underneath the hood.
/**
* @param {} pathname
* @param {} id: the id of the DELETE request.
* @param {} api: default is getLatestApiClient()
* @param {} axiosConfig: custom axiosConfig for this request
*/
function deleteRequest (pathname, id, api, axiosConfig)
FAQs
Library that makes integration of jsonapi with redux effortless and easy
We found that jsonapi-redux-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.