Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@advanced-rest-client/events-target-mixin

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@advanced-rest-client/events-target-mixin

Mixin that support event targets retargeting so the element listens on a set node instead of default one

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
358
increased by16.23%
Maintainers
1
Weekly downloads
 
Created
Source

Published on NPM

Build Status

A Mixin that support event targets retargeting so the element listens on a set node instead of default one (window).

API components

This components is a part of API components ecosystem

Usage

Installation

npm install --save @advanced-rest-client/events-target-mixin

In a web component

import { LitElement, html } from 'lit-element';
import { EventsTargetMixin } '@advanced-rest-client/events-target-mixin/events-target-mixin.js';

class SampleElement extends EventsTargetMixin(HTMLElement) {
  _attachListeners(node) {
    node.addEventListener('my-event', this._testEventHandler);
  }

  _detachListeners(node) {
    node.removeEventListener('my-event', this._testEventHandler);
  }

  _testEventHandler() {

  }
}
customElements.define('sample-element', SampleElement);
<sample-element id="example"></sample-element>
<div id="target"></div>
example.eventsTarget = target;

The element listens for events that bubbles through #target element.

Development

git clone https://github.com/advanced-rest-client/events-target-mixin
cd events-target-mixin
npm install

Running the tests

npm test

Keywords

FAQs

Package last updated on 20 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc