LogoRobo.js
Packages@robojs/sync

SyncCallContext<T, ClientData>

Interface: SyncCallContext<T, ClientData>

Context passed to RPC call handlers.

Type Parameters

Type ParameterDefault type
Tunknown
ClientDataunknown

Properties

PropertyTypeDescription
broadcast(payload: unknown) => voidBroadcast ephemeral message to all clients
cleanKeystringThe normalized key string
clientHandlerClient<ClientData>The client making the call
getClients() => Client<ClientData>[]Get all clients subscribed to this key
getHost() => undefined | stringGet current host client ID
getState() => undefined | TGet current state for this key
keystring[]The full key array
paramsRecord<string, string>Dynamic route parameters
send(clientId: string, payload: unknown) => voidSend ephemeral message to specific client
setState(data: T) => voidSet state (broadcasts automatically)

On this page