Socket
Socket
Sign inDemoInstall

@avidian/events

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @avidian/events

A pub/sub library for handling events.


Version published
Weekly downloads
6
increased by20%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@avidian/events

A pub/sub library for handling events.

Installation

NPM

npm install @avidian/events

Yarn

yarn add @avidian/events

Usage

import { Manager } from '@avidian/events';

const manager = new Manager();

// listen to events
const key = manager.on('my_event_key', (value) => {
    console.log(value);
}); // or manager.listen(name, callback)

// dispatch values to events
manager.dispatch('my_event_key', 'value');

// unlisten specific key to events
manager.off(key); // or manager.unlisten(key)

// clear all listeners
manager.clear();

License

MIT License

FAQs

Last updated on 18 Aug 2021

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