Gathering detailed insights and metrics for ember-destroyable-polyfill
Gathering detailed insights and metrics for ember-destroyable-polyfill
Gathering detailed insights and metrics for ember-destroyable-polyfill
Gathering detailed insights and metrics for ember-destroyable-polyfill
npm install ember-destroyable-polyfill
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
4 Stars
152 Commits
3 Forks
2 Watching
25 Branches
4 Contributors
Updated on 16 Nov 2022
JavaScript (91.83%)
HTML (7.94%)
Handlebars (0.22%)
Cumulative downloads
Total Downloads
Last day
-11.4%
12,318
Compared to previous day
Last week
-11.6%
66,967
Compared to previous week
Last month
24.8%
328,309
Compared to previous month
Last year
-8.5%
4,480,551
Compared to previous year
34
Polyfill for RFC 580 "Destroyables".
1ember install ember-destroyable-polyfill
For addons, pass the -S
flag.
ember-cli-babel
v7.22.1 or aboveAdds an API for registering destroyables and destructors with Ember's built in destruction hierarchy.
1import { registerDestructor } from '@ember/destroyable'; 2 3class MyComponent extends Component { 4 constructor() { 5 let timeoutId = setTimeout(() => console.log('hello'), 1000); 6 registerDestructor(this, () => clearTimeout(timeoutId)); 7 } 8}
The API will also enable users to create and manage their own destroyables, and associate them with a parent destroyable.
1import { 2 associateDestroyableChild, 3 registerDestructor 4} from '@ember/destroyable'; 5 6class TimeoutManager { 7 constructor(parent, fn, timeout = 1000) { 8 let timeoutId = setTimeout(fn, timeout); 9 associateDestroyableChild(parent, this); 10 registerDestructor(this, () => clearTimeout(timeoutId)); 11 } 12} 13 14class MyComponent extends Component { 15 manager = new TimeoutManager(this, () => console.log('hello')); 16}
For detailed usage instructions, refer to the RFC 580 "Destroyables".
TypeScript's normal type resolution for an import from @ember/destroyable
will not find this the types provided by this package (since TypeScript
would attempt to resolve it as node_modules/@ember/destroyable
or under
the Definitely Typed location for @ember/destroyable
). Once the
@ember/destroyable
API is a documented part of Ember's API, the
Definitely Typed folks will gladly accept adding that API, but in the
meantime users will need to modify their tsconfig.json
to tell TypeScript
where these types are.
Add the following to your tsconfig.json
:
1{ 2 // ...snip... 3 "paths": { 4 // ...snip... 5 "@ember/destroyable": ["node_modules/ember-destroyable-polyfill"], 6 } 7}
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/12 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
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
99 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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