Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/sse.ts>EventEndpoint#sendEvent

A JavaScript extension package for building strong and modern applications.
Latest
method EventEndpoint.prototype.sendEvent
import { EventEndpoint } from "https://deno.land/x/ayonli_jsext@v0.9.72/sse.ts";

Sends a custom event to the client.

The client (EventSource or EventConsumer) will receive the event as a MessageEvent, which can be listened to using the custom event name.

Parameters

event: string

If specified, the client will remember the value as the last event ID and will send it back to the server when reconnecting.

data: string
optional
eventId: string | undefined = [UNSUPPORTED]

Returns

Promise<void>