You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
353 B
15 lines
353 B
import _EventEmitter from "eventemitter3";
|
|
const emitter = new _EventEmitter();
|
|
export default class EventEmitter {
|
|
public emit(event: string, data?: any) {
|
|
emitter.emit(event, data);
|
|
}
|
|
|
|
public on(event: string, callback) {
|
|
emitter.on(event, callback);
|
|
}
|
|
|
|
public off(event: string, callback) {
|
|
emitter.off(event, callback);
|
|
}
|
|
} |