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

subscribable-lite

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

subscribable-lite

Super Light weight Subscribe/Publish event system for Node.js and browser

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
26
550%
Maintainers
1
Weekly downloads
 
Created
Source

subscribable-lite

Build Status Coverage Status

Super Light weight Subscribe/Publish event system for Node.js and browser. (UMD version only 395B after gzipped)

Installing

Using npm:

$ npm install subscribable-lite

Using yarn:

$ yarn add subscribable-lite

Usage

sub.subscribe(handler)

sub.publish([arg[, ...]])

import SubLite from 'subscribable-lite';

const sub = new SubLite();

sub.subscribe((a, b, c) => {
    console.log(a, b, c); // => 'you are awesome'
});
sub.publish('you', 'are', 'awesome');

sub.unsubscribe([handler])

const unsubscribe = sub.subscribe((a, b, c) => {
    console.log(a, b, c); // => 'will not trigger'
});

unsubscribe();
/* or `sub.unsubscribe();` */

sub.publish('you', 'are', 'awesome');

License

MIT (c) Christopher Peng (Cap32)

FAQs

Package last updated on 08 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