Socket
Socket
Sign inDemoInstall

@antv/event-emitter

Package Overview
Dependencies
0
Maintainers
57
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @antv/event-emitter

event emitter for antvis.


Version published
Weekly downloads
136K
decreased by-0.07%
Maintainers
57
Install size
17.4 kB
Created
Weekly downloads
 

Readme

Source

@antv/event-emitter

event-emitter for @antvis.

Install

npm i --save @antv/event-emitter

Usage

import EE from '@antv/event-emitter';

const ee = new EE();

ee.on('mouseover', () => {});

ee.once('click', () => {});

ee.on('*', () => {});

ee.emit('click', 1, 'hello', true);

ee.off('click');

API

Simple and similar with event-emitter.

  • on(evt: string, callback: Function): listen an event.
  • once(evt: string, callback: Function): listen a event only once.
  • emit(evt: string, ...parameters: any[]): emit / trigger an event with parameters.
  • off(evt?: string, callback?: Function): unsubscribe an event.
  • getEvents(): get all the exist events.

FAQs

Last updated on 10 Feb 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc