Skip to content

WebSocketSubscriptionCallbackManager

The callback manager for a WebSocketSubscription.

Type parameters

Type parameter
T extends SubscriptionTypes

Constructors

new WebSocketSubscriptionCallbackManager()

1
new WebSocketSubscriptionCallbackManager<T>(connection: WebSocketConnection): WebSocketSubscriptionCallbackManager<T>

Creates a new WebSocketSubscriptionCallbackManager.

Parameters

ParameterTypeDescription
connectionWebSocketConnectionThe connection that created this manager.

Returns

WebSocketSubscriptionCallbackManager<T>

Source

twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:28

Properties

PropertyModifierTypeDescription
connectionreadonlyWebSocketConnectionThe connection that created this manager.

Methods

add()

1
add(callback: WebSocketSubscriptionCallback<T>): this

Adds a callback to the manager.

Parameters

ParameterTypeDescription
callbackWebSocketSubscriptionCallback<T>The callback to add.

Returns

this

The manager.

Source

twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:40


execute()

1
execute(message: SubscriptionMessages<WebSocketConnection>[T]): Promise<void>

Executes all the callbacks with the message.

Parameters

ParameterTypeDescription
messageSubscriptionMessages<WebSocketConnection>[T]The message to execute the callbacks with.

Returns

Promise<void>

Source

twitchfy/packages/eventsub/src/ws/structures/WebSocketSubscriptionCallbackManager.ts:52