Gathering detailed insights and metrics for reduce-reducers
Gathering detailed insights and metrics for reduce-reducers
Gathering detailed insights and metrics for reduce-reducers
Gathering detailed insights and metrics for reduce-reducers
Reduce multiple reducers into a single reducer from left to right
npm install reduce-reducers
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
790 Stars
57 Commits
51 Forks
11 Watching
16 Branches
9 Contributors
Updated on 25 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5.5%
80,881
Compared to previous day
Last week
11.7%
458,743
Compared to previous week
Last month
17.3%
1,799,373
Compared to previous month
Last year
2%
20,991,473
Compared to previous year
Reduce multiple reducers into a single reducer from left to right
npm install reduce-reducers
1import reduceReducers from 'reduce-reducers'; 2 3const initialState = { A: 0, B: 0 }; 4 5const addReducer = (state, payload) => ({ ...state, A: state.A + payload }); 6const multReducer = (state, payload) => ({ ...state, B: state.B * payload }); 7 8const reducer = reduceReducers(initialState, addReducer, multReducer); 9 10const state = { A: 1, B: 2 }; 11const payload = 3; 12 13reducer(state, payload); // { A: 4, B: 6 }
Originally created to combine multiple Redux reducers that correspond to different actions (e.g. like this). Technically works with any reducer, not just with Redux, though I don't know of any other use cases.
reduceReducers
and combineReducers
?This StackOverflow post explains it very well: https://stackoverflow.com/a/44371190/5741172
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/29 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- 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
72 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
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 Morepostcss-reduce-transforms
Reduce transform functions with PostCSS.
postcss-reduce-initial
Reduce initial definitions to the actual initial value, where possible.
reduce-flatten
Isomorphic map-reduce function to flatten an array into the supplied array
reduce-css-calc
Reduce CSS calc() function to the maximum