Skip to content

API reference / @chanx-js/client / core / createTopicController

Function: createTopicController() ​

ts
function createTopicController<D, Ref>(
   client, 
   descriptor, 
   topic, 
   initialOptions?
): TopicController<Ref>;

Defined in: packages/client/src/core/controller.ts:486

Joins one topic. The common case, with the topic's own message types throughout: no union to narrow and no topic name to pass when sending.

Type Parameters ​

Type ParameterDefault type
D extends ChannelDescriptor<any, any, any, any>-
Ref extends TopicRef<ChanxMessage, ChanxMessage, string>TopicRefOf<D>

Parameters ​

ParameterType
clientChanxClient
descriptorD
topicRef
initialOptionsTopicControllerOptions<AddressOf<D>, Ref>

Returns ​

TopicController<Ref>

MIT licensed