Open orgads opened 9 months ago
ping
ping
i found solution,
import EventEmitter from "events";
import TypedEmitter, {EventMap} from "typed-emitter";
export default class TEventEmitter<T extends EventMap> extends (EventEmitter as { new<T extends EventMap>(): TypedEmitter<T> })<T>
{
}
then i use it by
import TEventEmitter from "@/utils/TEventEmitter";
export default class Browser extends TEventEmitter<BrowserEvents> {}
Unfortunately, looks like abandoned package.
This one works:
Hi,
The following example works with typed-emitter v1, but breaks with v2.
Error message:
My use-case is a class that extends another class, which is an
EventEmitter
, but needs to also implement typed events.