[]previous and next page

SseEvent

One event of an SSE stream, as the client hands it over.

One event of an SSE stream, as the client hands it over.

Import#

ts
import type { SseEvent } from "@shadow-js/dusk/client";

Signature#

ts
interface SseEvent<T> {
  /** The event name (`message` when the server named none). */
  readonly event: string;
  /** The payload, parsed by the client's `parse`. */
  readonly data: T;
  /** The event id, when the server sent one. */
  readonly id: string | undefined;
}

Members#

Name Type Description
T T
event readonly event: string The event name (message when the server named none).
data readonly data: T The payload, parsed by the client's parse.
id readonly id: string | undefined The event id, when the server sent one.