Gathering detailed insights and metrics for @advanced-rest-client/events-target-mixin
Gathering detailed insights and metrics for @advanced-rest-client/events-target-mixin
Gathering detailed insights and metrics for @advanced-rest-client/events-target-mixin
Gathering detailed insights and metrics for @advanced-rest-client/events-target-mixin
⛔️ DEPRECATED. Use the `@anypoint-web-components/awc` module instead.
npm install @advanced-rest-client/events-target-mixin
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
65 Commits
3 Branches
3 Contributors
Updated on Jan 28, 2023
Latest Version
3.2.6
Package Id
@advanced-rest-client/events-target-mixin@3.2.6
Size
11.33 kB
NPM Version
6.14.15
Node Version
14.18.0
Published on
Oct 18, 2021
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
Use the @anypoint-web-components/awc
module instead.
A Mixin that support event targets retargeting so the element listens on a set node instead of the default window
object.
1npm install @advanced-rest-client/events-target-mixin --save
1import { EventsTargetMixin } '@advanced-rest-client/events-target-mixin'; 2 3class SampleElement extends EventsTargetMixin(HTMLElement) { 4 _attachListeners(node) { 5 node.addEventListener('my-event', this._testEventHandler); 6 } 7 8 _detachListeners(node) { 9 node.removeEventListener('my-event', this._testEventHandler); 10 } 11 12 _testEventHandler() { 13 14 } 15} 16customElements.define('sample-element', SampleElement);
1<sample-element id="example"></sample-element> 2<div id="target"></div> 3<script> 4example.eventsTarget = target; 5</script>
The element listens for events that bubbles through #target element.
When constructing the object call the _eventsTargetChanged()
method with
an object that is the default events target. If argument is not set then window
is used instead.
1import { EventsTargetMixin } '@advanced-rest-client/events-target-mixin'; 2 3class EventableObject extends EventsTargetMixin(Object) { 4 constructor() { 5 super(); 6 this._eventsTargetChanged(); 7 } 8}
Because such class has no lifecycle methods, you should call detachedCallback()
manually when the instance should no longer listen on the target object. Skipping
this part may cause the GC to not clean the instance from memory.
1git clone https://github.com/advanced-rest-client/events-target-mixin 2cd events-target-mixin 3npm install
1npm test
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
project is archived
Details
Reason
detected GitHub workflow tokens with excessive permissions
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
25 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