Skip to content

Function: eventSourceProvider() ​

ts
function eventSourceProvider(options): ConfigProvider;

Defined in: providers/event-source.ts:52

Create a provider that gets the configuration document from a server-sent event stream.

Parameters ​

ParameterTypeDescription
optionsEventSourceProviderOptionsThe URL, the credentials mode and the provider name.

Returns ​

ConfigProvider

A provider that can load and subscribe.

Remarks ​

Each message contains a full document. load resolves with the first message. A message that is not a valid document goes to the error handler of each subscriber. The provider closes the stream when the last subscriber leaves or when the load signal aborts.

Example ​

ts
eventSourceProvider({ url: '/api/wand/stream', withCredentials: true });