Skip to main content
Version: v10.0.0

getEventSourceConstructor

The EventSource constructor to use: the one from adapterOptions , otherwise the global one (browsers, Deno, Bun). null when the runtime has none - pass one from the eventsource package in Node.js.


Import
import { getEventSourceConstructor } from "@hyper-fetch/sockets"

Parameters​

getEventSourceConstructor(adapterOptions: EmptyTypes | SSEAdapterOptionsType)
Parameters
NameTypeDescription
adapterOptions
EmptyTypes | SSEAdapterOptionsType

Returns​

null | (url: string | URL, eventSourceInitDict?: EventSourceInit) => EventSource