1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import {on, off, dispatch} from './event.js'
export default class EventTarget {
// Bind given event to listener
on (event, listener, binding, options) {
on(this, event, listener, binding, options)
return this
}
// Unbind event from listener
off (event, listener) {
off(this, event, listener)
return this
}
dispatch (event, data) {
return dispatch(this, event, data)
}
// Fire given event
fire (event, data) {
this.dispatch(event, data)
return this
}
}
|