11 lines
230 B
TypeScript
11 lines
230 B
TypeScript
import {EventEmitter} from 'events'
|
|
|
|
export class Emitter extends EventEmitter {
|
|
emit(type: string, ...args: any[]) {
|
|
const a = super.emit(type, ...args)
|
|
const b = super.emit('*', type, ...args)
|
|
|
|
return a && b
|
|
}
|
|
}
|