Gathering detailed insights and metrics for redux-normalize-axios-middleware
Gathering detailed insights and metrics for redux-normalize-axios-middleware
Gathering detailed insights and metrics for redux-normalize-axios-middleware
Gathering detailed insights and metrics for redux-normalize-axios-middleware
npm install redux-normalize-axios-middleware
Typescript
Module System
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
11 Stars
29 Commits
2 Forks
1 Watchers
1 Branches
3 Contributors
Updated on Jun 15, 2019
Latest Version
1.1.5
Package Id
redux-normalize-axios-middleware@1.1.5
Unpacked Size
8.83 kB
Size
3.16 kB
File Count
7
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
Normalize data using redux-axios-middleware and normalizr schema
yarn add redux-normalize-axios-middleware normalizr
Add normalizeAxiosMiddleware
1import normalizeAxiosMiddleware from 'redux-normalize-axios-middleware' 2 3const store = createStore(testReducer, applyMiddleware( 4 axiosMiddleware(axiosClient), 5 normalizeAxiosMiddleware 6))
Add normalizr schema to your action:
1import { schema } from 'normalizr' 2 3const fetchPosts = () => ({ 4 type: 'FETCH_POSTS', 5 payload: { 6 request: { 7 url: API_URL 8 } 9 }, 10 normalize: { 11 schema: new schema.Entity('posts'), 12 } 13})
This will normalize data and include ids of items:
1{ 2 data: { 3 posts: { 4 items: { 1: { id: 1, title: 'title' } }, 5 allIds: [1], 6 } 7 }, 8 ...remainingAxiosData 9}
If your data is nested you can use path
option to specify what should be normalized. The remaining part of data outside of path
will be omitted. path
uses lodash/get format:
1import { schema } from 'normalizr' 2 3const fetchPosts = () => ({ 4 type: 'FETCH_POSTS', 5 payload: { 6 request: { 7 url: API_URL 8 } 9 }, 10 normalize: { 11 schema: [new schema.Entity('posts')], 12 path: 'allPosts' 13 } 14})
This will normalize:
1{ 2 allPosts: [{ 3 id: 1, 4 title: 'title' 5 }], 6 someOtherData: 'lorem ipsum', 7}
To:
1{ 2 posts: { 3 items: { 1: { id: 1, title: 'title' } }, 4 allIds: [1], 5 } 6}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/25 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
91 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More