message: Simplify `extraterm-event-emitter`
diff: /*
  - * Copyright 2018 Simon Edwards <simon@simonzone.com>
  + * Copyright 2020 Simon Edwards <simon@simonzone.com>
  *
  * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file.
  */
  @@ -12,13 +12,12 @@ import {Disposable, Event} from '@extraterm/extraterm-extension-api';
  export class EventEmitter<T> implements Disposable {
  private _listeners: ((t: T) => void)[] = [];
  - private _disposables = new DisposableHolder();
  /**
  * Dispose of and disconnect all listeners.
  */
  dispose(): void {
  - this._disposables.dispose();
  + this._listeners = [];
  }
  /**
  @@ -29,10 +28,11 @@ export class EventEmitter<T> implements Disposable {
  */
  event: Event<T> = (listener: (t: T) => void): Disposable => {
  this._listeners.push(listener);
  - return this._disposables.add({
  + return {
  dispose: () => {
  this._listeners = this._listeners.filter(item => item !== listener);
  - }});
  + }
  + };
  }
  /**
  @@ -54,29 +54,3 @@ export class EventEmitter<T> implements Disposable {
  return this._listeners.length !== 0;
  }
  }
  -
  -/**
  - * A simple class for holding on to and disposing of multiple Disposable objects.
  - */
  -class DisposableHolder implements Disposable {
  -
  - private _list: Disposable[] = [];
  -
  - /**
  - * Add an object to the list of objects.
  - *
  - * @param d a Disposable object to hold on to.
  - * @return the object which was added.
  - */
  - add<D extends Disposable>(d: D): D {
  - this._list.push(d);
  - return d;
  - }
  -
  - dispose(): void {
  - for (const d of this._list) {
  - d.dispose();
  - }
  - this._list = [];
  - }
  -}
  