DataPublisher
Represents an object with an on function that you can call to subscribe to certain data over a
named channel.
Example
Type Parameters
Methods
on()
Call this to subscribe to data over a named channel.
Type Parameters
| Type Parameter |
|---|
TChannelName extends string | number | symbol |
Parameters
| Parameter | Type | Description |
|---|---|---|
channelName | TChannelName | The name of the channel on which to subscribe for messages |
subscriber | (data) => void | The function to call when a message becomes available |
options? | { signal: AbortSignal; } | - |
options.signal? | AbortSignal | An abort signal you can fire to unsubscribe |
Returns
UnsubscribeFn
A function that you can call to unsubscribe