refactor: split api routes by concern
This commit is contained in:
@@ -20,7 +20,7 @@ function sendJson(clients: Set<ClientLike>, event: ModerationWsEvent): void {
|
||||
} catch (error) {
|
||||
log.warn(
|
||||
{ error, eventType: event.type },
|
||||
"Failed to send event to client"
|
||||
"Failed to send event to client",
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,9 @@ export function createBroadcaster() {
|
||||
clientCount() {
|
||||
return clients.size;
|
||||
},
|
||||
getClients() {
|
||||
return Array.from(clients);
|
||||
},
|
||||
uiState(state: unknown) {
|
||||
sendJson(clients, { type: "ui_state", state });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user