15 lines
419 B
TypeScript
15 lines
419 B
TypeScript
import type { UserConnection } from '../UserConnection.ts';
|
|
import { log } from '../utils/logs.ts';
|
|
|
|
export function handleClose(
|
|
connection: UserConnection,
|
|
subscriptionId: string,
|
|
) {
|
|
if (!connection.subscriptions.has(subscriptionId)) {
|
|
return log.warn(
|
|
`Closing unknown subscription? That's weird. Subscription ID: ${subscriptionId}`,
|
|
);
|
|
}
|
|
|
|
connection.subscriptions.delete(subscriptionId);
|
|
}
|