2.0.0 • Published 6 years ago
yaemit v2.0.0
yaemit
Install
npm --save install yaemit
Example
Direct usage of Emitter:
import Emitter from 'yaemit'
const e = new Emitter()
const fn = (input) => console.log('hello', input)
e.on('event', fn)
e.emit('event', 'world')
Context binding for the event handler:
e.on('event', handler.bind(context))
Emitter can be extended:
class Hello extends Emitter {
constructor() {
this.on('event', this.hello)
}
hello(input) {
console.log('hello', input)
}
}
(new Hello()).emit('event', 'world')
2.0.0
6 years ago
1.9.0
7 years ago
1.8.0
7 years ago
1.7.2
7 years ago
1.7.1
7 years ago
1.7.0
7 years ago
1.6.4
7 years ago
1.6.3
7 years ago
1.6.2
7 years ago
1.6.1
7 years ago
1.6.0
7 years ago
1.5.0
7 years ago
1.4.0
7 years ago
1.3.0
7 years ago
1.2.4
7 years ago
1.2.3
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago