x/evt@v1.10.2/lib/Evt.create.ts

šŸ’§EventEmitter's typesafe replacement
GitHub Stars
365
Go to latest

import { importProxy } from "./importProxy.ts";
type Evt<T> = import("./types/interfaces/index.ts").Evt<T>;type VoidEvt= import("./types/interfaces/index.ts").VoidEvt;type StatefulEvt<T> = import("./types/interfaces/index.ts").StatefulEvt<T>;
/** * https://docs.evt.land/api/evt/create * Return a new VoidEvt instance. */export function create(): VoidEvt;/** * https://docs.evt.land/api/evt/create * Return a new Evt<T> instance. */export function create<T>(): Evt<T>;/** * https://docs.evt.land/api/evt/create * Return a new StatefulEvt<T> instance. */export function create<T>(initialState: T): StatefulEvt<T>;export function create(...args: [] | [any] ): Evt<any> | StatefulEvt<any> { return args.length === 0 ? new importProxy.Evt() : new importProxy.StatefulEvt(args[0]) ;}