2.0.0 • Published 8 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
8 years ago
1.9.0
8 years ago
1.8.0
8 years ago
1.7.2
8 years ago
1.7.1
8 years ago
1.7.0
8 years ago
1.6.4
8 years ago
1.6.3
8 years ago
1.6.2
8 years ago
1.6.1
8 years ago
1.6.0
8 years ago
1.5.0
8 years ago
1.4.0
8 years ago
1.3.0
8 years ago
1.2.4
9 years ago
1.2.3
9 years ago
1.2.1
9 years ago
1.2.0
9 years ago
1.1.0
9 years ago
1.0.0
9 years ago