You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@archjs/event-notifier

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@archjs/event-notifier

Event based on ReactiveX Subject

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
3
-70%
Maintainers
2
Weekly downloads
 
Created
Source

event-enotifier

Info

language: typescript

module type: commonjs

dependncies: rxjs

description: Event emitter/notifier class using rxjs/Subject as events.

Instalation

npm install @archjs/event-notifier

package.json

{
   ...
   dependencies:{
      ...
      "@archjs/event-notifier": "*",
      ...
   }
   ...
}

development install git clone git@gitlab.com:softem/archjs/core/event-notifier.git

Usage

creation

import {EventNotifier} from '@archjs/event-notifier/EventNotifier';
var norifier = new EventNotifier(); // no cosntructor parameters
var norifier = new EventNotifier(['click','change']); //constructor with events

Register new event to notifier

notifier.createEvent('myCustomEventName');

Attach new observer to event

notifier.on('myCustomEventName', function(data){ 
    console.log('myCustomEventName triggered');
});

Trigger event

notifier.trigger('myCustomEventName', { name:'myCustomEventName' } );

Unsubscribe

var observer = notifier.on('myCustomEventName', function(data){ 
    console.log('myCustomEventName triggered');
});
observer.unsubscribe();

FAQs

Package last updated on 09 Oct 2017

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