0.3.0 • Published 6 months ago

zen-mitt v0.3.0

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

zen-mitt

light-weight(187B min+gzip) typesafe event emitter

const events = mitt<{
  foo: number
  arr: string[]
  param: [name: string, age?: number]
}>()
events.on('foo', console.log)
events.emit('foo', 1)

events.on('arr', console.log)
events.emit('arr', ['test'])
events.off('arr')

events.once('param', console.log)
events.emit('param', 'test', 1)

events.off() // clear all listeners
0.3.0

6 months ago

0.2.0

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago