Gathering detailed insights and metrics for trashable-react
Gathering detailed insights and metrics for trashable-react
Gathering detailed insights and metrics for trashable-react
Gathering detailed insights and metrics for trashable-react
A HOC to make React Components garbage collectable when unmounted.
npm install trashable-react
Typescript
Module System
Node Version
NPM Version
67.3
Supply Chain
81
Quality
75.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
33 Stars
28 Commits
4 Forks
1 Watchers
2 Branches
3 Contributors
Updated on May 07, 2023
Latest Version
1.1.0
Package Id
trashable-react@1.1.0
Unpacked Size
162.90 kB
Size
44.18 kB
File Count
11
NPM Version
6.4.1
Node Version
10.15.1
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
1
21
A Higher Order Component to make React Components garbage collectable when unmounted.
Learn more about garbage collection and trashable
and why you should use it here.
npm install --save trashable-react
import makeComponentTrashable from 'trashable-react';
class Component extends React.Component {
componentDidMount() {
this.props.registerPromise(apiCall()).then(() => {
// ...
}).catch(() => {
// ...
});
}
}
// Passes the registerPromise() function to Component
export default makeComponentTrashable(Component);
You need to register the promise before you add your then
and catch
handlers. Otherwise, you will not get the garbage collection benefits.
// Do this
const registeredPromise = registerPromise(promise);
registeredPromise.then(() => {});
// NOT this
const handledPromise = promise.then(() => {});
registerPromise(handledPromise);
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/28 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 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
75 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