Skip to content

API reference / @chanx-js/client / vue / useTopics

Function: useTopics() ​

ts
function useTopics<D, Refs>(descriptor, options): UseTopicsResult<ToServerOf<D>, Refs[number]>;

Defined in: packages/client/src/vue/index.ts:234

Join several topics over the channel's single connection: for a set that varies at runtime. For one topic, useTopic is simpler and fully typed.

Same lifecycle as useChannel. params, queryParams and topics may be refs: a change rejoins.

Type Parameters ​

Type Parameter
D extends ChannelDescriptor<any, any, any, any>
Refs extends readonly TopicRefOf<D>[]

Parameters ​

ParameterType
descriptorD
optionsOmit<TopicsControllerOptions<AddressOf<D>, Refs[number]>, "params" | "topics" | "queryParams"> & ReactiveConnectOptions & object

Returns ​

UseTopicsResult<ToServerOf<D>, Refs[number]>

MIT licensed