Provides additional features to event emitters
    Preparing search index...

    Interface JustEventUno<Type, Value>

    Event with Value only

    interface JustEventUno<Type extends string, Value> {
        type: Type;
        emitBy(emitter: EventEmitterLike | EventTargetLike, value: Value): void;
        listener(listener: (value: Value) => unknown): (...args: any[]) => any;
        listenTo(
            emitter: EventEmitterLike | EventTargetLike,
            listener: (value: Value) => unknown,
        ): void;
        (value: Value): JustUno<Value>;
    }

    Type Parameters

    • Type extends string
    • Value
    • Create event argments as in emitter.emit(event.type, ...event(value)).

      Parameters

      Returns JustUno<Value>

    Index
    type: Type

    The event type: emitter.emit(event.type)

    • creates the event listener with type support

      Parameters

      • listener: (value: Value) => unknown

      Returns (...args: any[]) => any