Skip to content

API reference / @chanx-js/client / solid / createTopic

Function: createTopic() ​

ts
function createTopic<D, T>(
   descriptor, 
   topic, 
   options?
): TopicResult<T>;

Defined in: packages/client/src/solid/index.ts:204

Join one topic, typed from that topic throughout: createTopic(hub, hub.topics.roomTopic.with({ room_name: 'lobby' })). Same lifecycle as createChannel.

Type Parameters ​

Type Parameter
D extends ChannelDescriptor<any, any, any, any>
T extends TopicRef<ChanxMessage, ChanxMessage, string>

Parameters ​

ParameterType
descriptorD
topicT
optionsTopicControllerOptions<AddressOf<D>, T> & object

Returns ​

TopicResult<T>

MIT licensed