import EventEmitter from 'react-native/Libraries/vendor/emitter/EventEmitter';
import { StrictEventEmitter } from 'strict-event-emitter-types';

/**
 * Declare events using a simple interface mapping event names to their payloads
 * to get stricter versions of emit, on, and other common EventEmitter APIs
 *
 * @link https://medium.com/@bterlson/strongly-typed-event-emitters-2c2345801de8
 */
export class EventBus<E> extends EventEmitter {
  bus: StrictEventEmitter<EventEmitter, E>;

  constructor() {
    super();
    this.bus = new EventEmitter();
  }
}
