mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-28 00:47:13 +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
|
* 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
|
* After creation, no other handler can be registered for SubscriptionRequest on the controller
|
||||||
*/
|
*/
|
||||||
export class SubscriptionController {
|
export class SubscriptionController {
|
||||||
_events = new Map<string, {
|
_events = new Map<string, EventData>();
|
||||||
subscriptionUpdate?: SubscriptionRequestHandler<unknown>,
|
|
||||||
subscriptions: Map<Link, { all: boolean, channels: Array<string | number>, onceClose: () => void }>,
|
|
||||||
}>();
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private controller: any, // Controller | Link
|
private controller: any, // Controller | Link
|
||||||
|
|||||||
Reference in new issue
Block a user