Gathering detailed insights and metrics for react-trashable
Gathering detailed insights and metrics for react-trashable
Gathering detailed insights and metrics for react-trashable
Gathering detailed insights and metrics for react-trashable
A HOC to make React Components garbage collectable when unmounted.
npm install react-trashable
Typescript
Module System
Min. Node Version
Node Version
NPM Version
67.5
Supply Chain
82.2
Quality
74.4
Maintenance
100
Vulnerability
99.6
License
TypeScript (69.27%)
JavaScript (30.73%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
31 Commits
2 Branches
1 Contributors
Updated on Jun 06, 2019
Latest Version
0.1.1
Package Id
react-trashable@0.1.1
Unpacked Size
43.96 kB
Size
7.75 kB
File Count
9
NPM Version
6.4.1
Node Version
8.16.0
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
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.
Using npm:
npm install --save react-trashable
Using yarn:
yarn add react-trashable
import { withTrashable } from 'react-trashable';
class Component extends React.Component {
componentDidMount() {
this.props.registerPromise(apiCall()).then(() => {
// ...
}).catch(() => {
// ...
});
}
}
// Passes the registerPromise() function to Component
export default withTrashable(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
no SAST tool detected
Details
Reason
Found 0/30 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
32 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