1.0.1 • Published 2 years ago

yocto-queue-d v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

mitt-d

mitt

npm

npm install mitt-d

Usage

import mitt from 'mitt'

const emitter = mitt()

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

// listen to all events
emitter.on('*', (type, e) => console.log(type, e) )

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

// clearing all events
emitter.all.clear()

// working with handler references:
function onFoo() {}
emitter.on('foo', onFoo)   // listen
emitter.off('foo', onFoo)  // unlisten
1.0.1

2 years ago

1.0.0

2 years ago