New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@nbottarini/eventbus

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nbottarini/eventbus

Simple and lightweight EventBus implementation

latest
Source
npmnpm
Version
0.7.1
Version published
Maintainers
1
Created
Source

npm License: MIT CI Status

EventBus

Simple and lightweight EventBus javascript implementation

Installation

Npm:

$ npm install --save @nbottarini/eventbus

Yarn:

$ yarn add @nbottarini/eventbus

Usage

class Producer {
    constructor(private eventBus: EventBus) {}

    async doSomething() {
        await eventBus.post(new SampleEvent())
    }
}

class Consumer {
    constructor(private eventBus: EventBus) {
        this.eventBus.subscribe(this, SampleEvent, this.onSampleEvent)        
    }

    onSampleEvent(event: SampleEvent) {
        // Do Something
    }
}

class SampleEvent extends EventInterface {
}

Keywords

eventbus

FAQs

Package last updated on 09 Aug 2023

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