Throw error in trackListener as well

This commit is contained in:
R Midhun Suresh 2025-08-11 10:43:36 +05:30
parent 4caf52abf3
commit ce2f9ae32a
No known key found for this signature in database

View File

@ -50,6 +50,7 @@ export class Disposables {
* Add an event listener that will be removed on dispose
*/
public trackListener(emitter: EventEmitter, event: string, callback: (...args: unknown[]) => void): void {
this.throwIfDisposed();
emitter.on(event, callback);
this.track(() => {
emitter.off(event, callback);