Options
All
  • Public
  • Public/Protected
  • All
Menu

ts-typed-events

This is a very simple strongly typed event emitter class, see README.md for more details.

Index

Type aliases

Emitter

Emitter<T, TEvent>: BaseEmitterFunc<T> & { emit: Emitter<T, TEvent>; event: TEvent }

An emitter function with itself and its event as properties keyed on it.

Type parameters

Functions

createEmitter

  • Creates and returns an emitter for a SealedEvent, with the event keyed off the emitter via .event.

    Type parameters

    • T = undefined

    Returns Emitter<T, SealedEvent<T>>

    An emitter function that will emit to the .event SealedEvent.

createEventEmitter

  • Creates and returns an emitter for an Event, with the event keyed off the emitter via .event. Note: The event here is will have a member function .emit that emits to the same function as the emitter returned here.

    Type parameters

    • T = undefined

    Returns Emitter<T, Event<T>>

    An emitter function that will emit to the .event Event.

Generated using TypeDoc