* Removes a callback from this event instance. * @param handler - the callback to be removed from this event.
(handler: T extends void ? { (): void } : { (data: T): void })
| 21 | * @param handler - the callback to be removed from this event. |
| 22 | */ |
| 23 | remove(handler: T extends void ? { (): void } : { (data: T): void }): void { |
| 24 | this.handlers = this.handlers.filter((h) => h !== handler); |
| 25 | } |
| 26 | |
| 27 | /** Triggers all the callbacks assigned to this event. */ |
| 28 | trigger = async (data?: T) => { |