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
| Parameter | Type | Description |
|---|---|---|
options | EventSourceProviderOptions | The URL, the credentials mode and the provider name. |
Returns
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 });