cuspin

1.0.9 • Public • Published

cuspin

Minimal JavaScript Event Manager

Install

npm install cuspin

Usage

import { subscribe, subscribeOnce, emit } from 'cuspin';
 
// subscribe to an event
subscribe('example', (args) => {
    console.log(args)
})
 
// subscribe once to an event
subscribeOnce('example', (args) => {
    console.log(args);
})
 
// emit event
emit('example', 'Hello world!');
emit('example', { message: 'Hello world!' });
emit('example', ['Hello', 'world!']);

Readme

Keywords

Package Sidebar

Install

npm i cuspin

Weekly Downloads

0

Version

1.0.9

License

ISC

Unpacked Size

3.47 kB

Total Files

4

Last publish

Collaborators

  • dark64