Gathering detailed insights and metrics for reselect-map-change-memoize
Gathering detailed insights and metrics for reselect-map-change-memoize
npm install reselect-map-change-memoize
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,318
Last Day
1
Last Week
2
Last Month
17
Last Year
87
MIT License
2 Stars
4 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Jun 16, 2017
Minified
Minified + Gzipped
Latest Version
0.0.3
Package Id
reselect-map-change-memoize@0.0.3
Size
3.94 kB
NPM Version
2.14.12
Node Version
4.3.2
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
112.5%
17
Compared to previous month
Last Year
-14.7%
87
Compared to previous year
A simple memoize function for reselect-map which performs a callback every time the result changes. This is to reselect-map the same as reselect-change-memoize is for reselect.
This is alpha software, use at your own risk.
1import { createSelectorWithChangeCallback } from 'reselect-map-change-memoize'; 2 3 // eslint-disable-next-line no-unused-vars 4 function myCallback(lastArgs, lastResult, newArgs, newResult) { 5 // Your code 6 } 7 8 const selector = createArraySelectorWithChangeCallback( 9 myCallback, 10 (state) => state.arrayState, 11 (state) => state.id, 12 (arrayState, id) => { // eslint-disable-line arrow-body-style 13 return {arrayState, id}; 14 } 15 ); 16 17 selector({arrayState: [1, 2, 3], initial: 'state'});
Alternatively, using the basic logging create selector
1import { createSelector } from 'reselect-change-memoize' 2import { createArraySelector } from 'reselect-map-change-memoize'; 3 4 const selector1 = createArraySelector( 5 'An awesome array selector', 6 (state) => state.arrayState, 7 (state) => state.id, 8 (arrayItem, id) => { 9 return {arrayItem, id}; 10 } 11 ); 12 const selector2 = createSelector( 13 'A second awesome selector which uses the first awesome selector', 14 selector1, 15 (selector1Array) => { 16 return {selector2: selector1Array}; 17 } 18 ); 19 // The name doesn't not have to be provided 20 const selector3 = createArraySelector( 21 selector1, 22 (selector1Item) => { 23 return {selector2ArrayItem: selector1Item}; 24 } 25 ); 26 27 const state = {arrayState: [1, 2, 3], id: 'id'}; 28 selector2(state); 29 selector1(state); 30 selector3(state);
produces
- An awesome array selector
lastArgs: {}
lastResult: {}
newArgs: [ [ 1, 2, 3 ], 'id' ]
newResult: [ { arrayItem: 1, id: 'id' }, { arrayItem: 2, id: 'id' }, { arrayItem: 3, id: 'id' } ]
- A second awesome selector which uses the first awesome selector
lastArgs: {}
lastResult: {}
newArgs: [ [ { arrayItem: 1, id: 'id' },
{ arrayItem: 2, id: 'id' },
{ arrayItem: 3, id: 'id' } ] ]
newResult: { selector2:
[ { arrayItem: 1, id: 'id' }, { arrayItem: 2, id: 'id' }, { arrayItem: 3, id: 'id' } ]
}
- unknown
lastArgs: {}
lastResult: {}
newArgs: [ [ { arrayItem: 1, id: 'id' },
{ arrayItem: 2, id: 'id' },
{ arrayItem: 3, id: 'id' } ] ]
newResult: [ { selector2ArrayItem: { arrayItem: 1, id: 'id' } }, { selector2ArrayItem: { arrayItem: 2, id: 'id' } }, { selector2ArrayItem: { arrayItem: 3, id: 'id' } } ]
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-03-10
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