From 54cb483a315b853ee530781af51cb58c3a7c78d0 Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Fri, 13 Oct 2023 11:21:55 +0100 Subject: [PATCH] Convert overloads to generic function Co-authored-by: Hornwitser --- packages/lib/src/subscriptions.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/lib/src/subscriptions.ts b/packages/lib/src/subscriptions.ts index 0b186504..ae346b65 100644 --- a/packages/lib/src/subscriptions.ts +++ b/packages/lib/src/subscriptions.ts @@ -131,11 +131,7 @@ export class SubscriptionController { * Allow clients to subscribe to an event by telling the subscription controller to accept them * Has an optional subscription update handler which is called when any client updates their subscription */ - handle(Event: EventClass, subscriptionUpdate?: SubscriptionRequestHandler,): void; - handle( - Event: EventClass, - subscriptionUpdate?: SubscriptionRequestHandler, - ) { + handle(Event: EventClass, subscriptionUpdate?: SubscriptionRequestHandler) { const entry = Link._eventsByClass.get(Event); if (!entry) { throw new Error(`Unregistered Event class ${Event.name}`); @@ -152,8 +148,7 @@ export class SubscriptionController { /** * Broadcast an event to all subscribers of that event, will be filtered by channel if a ChannelEvent is provided */ - broadcast(event: Event | ChannelEvent): void; - broadcast(event: Event | ChannelEvent) { + broadcast(event: Event | ChannelEvent) { const entry = Link._eventsByClass.get(event.constructor); if (!entry) { throw new Error(`Unregistered Event class ${event.constructor.name}`);