event-whale

1.0.0 • Public • Published

Event-Whale

event emitter / pubsub

Install

npm install event-whale

Usage

import EventWhale from 'event-whale'

const eventWhale = new EventWhale()

// listen to an event
eventWhale.on('foo', e => console.log('foo', e))

// listen to an event only once
eventWhale.once('foo', e => console.log('foo', e))

// fire an event
eventWhale.emit('foo', { a: 'b' })

// close an event
eventWhale.off('foo')

// clearing all events
eventWhale.clear()

Package Sidebar

Install

npm i event-whale

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.04 kB

Total Files

4

Last publish

Collaborators

  • ismufang