SocketRegistry
tipo
Registro de clientes Socket por nombre de canal, como el autoimport socket. Cada canal se
conecta la primera vez que se lee, sólo en el navegador.
ts
import type { SocketRegistry } from "@meekojs/meeko/framework";Source code src/app/runtime/socket.ts:174
Declaración #
ts
type SocketRegistry<C extends Record<string, SocketContract>> = {
readonly [K in keyof C]: SocketClient<C[K]>
}Type parameters #
-
Cextends Record<string, SocketContract>
Example #
ts
import { createSocketRegistry } from "@meekojs/meeko/framework";
import type { SocketRegistry } from "@meekojs/meeko/framework";
const socket: SocketRegistry<typeof socketContracts> = createSocketRegistry(socketContracts);
socket.chat.on("message", (message) => console.log(message.text));