The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsThe dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
Return a Set of channels tracked by this Hub that match query.
Get a set of Message that were already sent to the channel.
Messages are returned in reverse chronological order (most recent -> oldest),
Set of query options for retrieving messages.
Describes a query to Hub.getMessages for messages.
A argument (or array of arguments) which can resolve to channel names.
Optionallimit?: numberThe number of messages to return.
Optionalorder?: "ASC" | "DESC"Messages are sorted by order of dispatch: ASC is oldest -> newest, DESC is newest -> oldest.
All messages from matching channel(s) which match query.
Create a channel named name.
If such a channel already exists, this method will return the name of the existing channel.
Publish a message to a particular channel, or channels.
Returns a Promise which resolves when all callbacks attached to routes have completed. If a callback thr
Callbacks which returned void or undefined will have the value true.
The type of the payload carried by the message(s) being published.
Channel route (i.e., a channel name, wildcard string, or RegExp) to publish to, or an array of the same. Routes which are not fully-qualified (i.e., they are a wildcard string or a regular expression) will only dispatch to channels which are already registered on the Hub. Fully qualified route names for unregistered channels will result in the creation of a channel with that name.
The item to dispatch to routes.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.
Optionaloptions: boolean | EventListenerOptionsListen to messages sent to a particular channel.
Returns a method which, when called, will terminate the subscription;
callback will not receive any further messages. Optionally, this
unsub method takes a string argument, indicating why we haveThis method attempts to call listener for all historical messages
in the order in which they were received, but it is theoretically
possible to construct a circumstance in which messages might be
received out of order. Message.order will always be greater
for messages that have been dispatched more recently. However, it is
a generally good practice for listener to be idempotent.
Value carried by the message.
Name of the channel to subscribe to. Does not need to exist to be subscribed to. Passing * will subscribe to all channels.
Called with message payload and channel name when a message is published.
Optionalbacklog: number = 0Number of old messages in the channel(s) to send to listener before attaching subscription. *
OptionallistenerOptions: AddEventListenerOptions = {}Options passed directly to addEventListener(). Use with caution.
Hub for sending and registering to receive messages.