mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Name a type for event data
Use a named type for the EventData used in subscriptions. This was done as a workaround for a bug in the linter.
This commit is contained in:
1 parent
2a1821993c
commit
9f31394318
1 file changed
+6
-4
@@ -110,15 +110,17 @@ export class SubscriptionRequest {
|
||||
}
|
||||
}
|
||||
|
||||
type EventData = {
|
||||
subscriptionUpdate?: SubscriptionRequestHandler<unknown>,
|
||||
subscriptions: Map<Link, { all: boolean, channels: Array<string | number>, onceClose: () => void }>,
|
||||
};
|
||||
|
||||
/**
|
||||
* A class component to handle incoming subscription requests and offers a method to broadcast events to subscribers
|
||||
* After creation, no other handler can be registered for SubscriptionRequest on the controller
|
||||
*/
|
||||
export class SubscriptionController {
|
||||
_events = new Map<string, {
|
||||
subscriptionUpdate?: SubscriptionRequestHandler<unknown>,
|
||||
subscriptions: Map<Link, { all: boolean, channels: Array<string | number>, onceClose: () => void }>,
|
||||
}>();
|
||||
_events = new Map<string, EventData>();
|
||||
|
||||
constructor(
|
||||
private controller: any, // Controller | Link
|
||||
|
||||
Reference in new issue
Block a user