Gathering detailed insights and metrics for use-reselect
Gathering detailed insights and metrics for use-reselect
Gathering detailed insights and metrics for use-reselect
Gathering detailed insights and metrics for use-reselect
npm install use-reselect
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
6 Stars
3 Commits
3 Watching
2 Branches
1 Contributors
Updated on 08 Aug 2019
TypeScript (66.89%)
JavaScript (31.31%)
HTML (1.8%)
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
-50%
3
Compared to previous month
Last year
40.3%
101
Compared to previous year
DEVELOPMENT PREVIEW
This is a fork of reselect, mixed with kashe and React hooks
.
Make reselect
more hooks
compatible by providing automatic per-instance memoization. To achive this
memoized value would not be stored just inside createSelector
, but also inside per-instance WeakMap
with selector
used a key.
API is 100% compatible with Reselect.
createSelector
- as seen in reselectuseReselect(cb)
- selection runner. All selectors inside would be executed inside a sandbox, making result instance bound.1const getUser = createSelector((state: any, userId: string) => ( 2 state.users[userId] + `:${recomputations++}` 3), i => i); 4 5const User = ({userId, tick}) => { 6 const userName = useReselect(() => getUser(state, userId)); 7 return <span>user({userId}): {userName}</span> 8} 9 10// this would work 11<> 12 <User userId="user1" /> 13 <User userId="user2" /> 14</> 15 16 17// this would not, getUser still could hold only one result 18const DoubleUser = ({userId, tick}) => { 19 const [u1, u2] = useReselect(() => [getUser(state, 'a'),getUser(state, 'b')]); 20 return <span>{u1} - {u2}</span> 21}
useReReselect(cb)
- selection runner. Every selector inside would be executed in a personal sandbox, making it instance bound1// every selector would be executed in a personal sandbox 2const DoubleUser = ({userId, tick}) => { 3 const [u1, u2] = useReReselect(() => [getUser(state, 'a'),getUser(state, 'b')]); 4 return <span>{u1} - {u2}</span> 5}
1// run it once 2const [u1, u2] = useReReselect(() => [getUser(state, 'a'),getUser(state, 'b')]); 3// get "hooks" 4const stack = useReReselect.getStack(); 5 6// run it with "custom hooks" 7const [u1, u2] = useReReselect(() => [getUser(state, 'a'),getUser(state, 'b')], stack);
All selectors are double memoized, letting shareable data be shared.
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/3 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
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
123 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 More