WebSocketSubscriptionCallbackManager
The callback manager for a WebSocketSubscription.
Type parameters
| Type parameter |
|---|
T extends SubscriptionTypes |
Constructors
new WebSocketSubscriptionCallbackManager()
1new WebSocketSubscriptionCallbackManager<T>(connection: WebSocketConnection): WebSocketSubscriptionCallbackManager<T>Creates a new WebSocketSubscriptionCallbackManager.
Parameters
| Parameter | Type | Description |
|---|---|---|
connection | WebSocketConnection | The connection that created this manager. |
Returns
WebSocketSubscriptionCallbackManager<T>
Source
twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:28
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
connection | readonly | WebSocketConnection | The connection that created this manager. |
Methods
add()
1add(callback: WebSocketSubscriptionCallback<T>): thisAdds a callback to the manager.
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | WebSocketSubscriptionCallback<T> | The callback to add. |
Returns
this
The manager.
Source
twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:40
execute()
1execute(message: SubscriptionMessages<WebSocketConnection>[T]): Promise<void>Executes all the callbacks with the message.
Parameters
| Parameter | Type | Description |
|---|---|---|
message | SubscriptionMessages<WebSocketConnection>[T] | The message to execute the callbacks with. |
Returns
Promise<void>
Source
twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:52