Rxova
Skip to content

ChannelHooks

A channel bound to a name and message map: typed hooks with no per-call generics.

Type Parameter
M extends MessageMap
get: () => Channel<M>;

The underlying channel instance (the same one the hooks use) — for non-React code.

Channel<M>


useMessage: <K>(type, handler) => void;

Subscribe to one message type. Same contract as the standalone useMessage: the handler is kept fresh without resubscribing.

Type Parameter
K extends string
ParameterType
typeK
handler(payload, meta) => void

void


useSend: () => <K>(type, payload, options?) => void;

The channel’s post function (stable identity).

<K>(
type,
payload,
options?): void;

Fire-and-forget to every other tab/window/worker on this origin.

Type Parameter
K extends string
ParameterType
typeK
payloadM[K]
options?PostOptions

void