Interface JustEventDuo<Type, Value, Meta>

Type Parameters

  • Type extends string

  • Value

  • Meta extends JustMeta

Hierarchy

  • JustEventDuo
  • Create event argments as in emitter.emit(event.type, ...event(value, meta)).

    Parameters

    • value: Value
    • meta: Meta

    Returns JustDuo<Value, Meta>

Properties

Methods

Properties

type: Type

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

Methods

  • A functional and normalized way to call emitter.emit(...)

    Parameters

    • emitter: EventEmitterLike | EventTargetLike
    • value: Value
    • meta: Meta

    Returns void

  • A functional and normalized way to call emitter.addListener(...)

    Parameters

    • emitter: EventEmitterLike | EventTargetLike
    • listener: ((value: Value, meta: Meta) => unknown)
        • (value: Value, meta: Meta): unknown
        • Parameters

          • value: Value
          • meta: Meta

          Returns unknown

    Returns void

  • creates the event listener with type support

    Parameters

    • listener: ((value: Value, meta: Meta) => unknown)
        • (value: Value, meta: Meta): unknown
        • Parameters

          • value: Value
          • meta: Meta

          Returns unknown

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

      • (...args: any[]): any
      • creates the event listener with type support

        Parameters

        • Rest ...args: any[]

        Returns any

Generated using TypeDoc