Skip to main content
Module

x/oak/deps.ts>ServerSentEventInit

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
interface ServerSentEventInit
implements EventInit
import { type ServerSentEventInit } from "https://deno.land/x/oak@v12.5.0/deps.ts";

Properties

optional
data: unknown

Optional arbitrary data to send to the client, data this is a string will be sent unmodified, otherwise JSON.parse() will be used to serialize the value.

optional
id: number

An optional id which will be sent with the event and exposed in the client EventSource.

optional
replacer: (string | number)[] | ((
this: any,
key: string,
value: any,
) => any)

The replacer is passed to JSON.stringify when converting the data property to a JSON string.

optional
space: string | number

Space is passed to JSON.stringify when converting the data property to a JSON string.