Skip to content

fireEvent

fireEvent<TS, TE>(source, event): void

Fires an Event instance to all clients that are subscribed.

  • Any Data or Endpoints referred to by properties on the Event that have had changes during the current endpoint method call must be manually saved before calling fireEvent. Otherwise, an exception is thrown. This ensures a consistent state for client-side event subscribers.
  • Events will not be fired when an endpoint call returns an error or an exception is unhandled by your code.

Type parameters

TS extends Endpoint | Data

TE extends Event

Parameters

source: TS

A reference to an Endpoint or Data which will be used as the source of this event.

event: TE

The Event object to send to all subscribed clients.

Returns

void


Generated using typedoc-plugin-markdown and TypeDoc