1.8.1
Extensions fromEvent, fromEmitter and fromEmitterArgs no longer use strict types. They now expect Event
-like and EventEmitter
-like types, to support any custom types that implement the minimum of original API.
For example, popular EventEmitter3 now can be used directly, without hard type re-casting.
import {EventEmitter} from "eventemitter3";
import {fromEmitter} from "sub-events/ext";
const e = new EventEmitter(); // our custom emitter
const event = fromEmitter(e, 'receive'); // accepts compatible type without re-casting