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 Parameter | Default type |
|---|---|
D extends ChannelDescriptor<any, any, any, any> | - |
Ref extends TopicRef<ChanxMessage, ChanxMessage, string> | TopicRefOf<D> |
Parameters
| Parameter | Type |
|---|---|
client | ChanxClient |
descriptor | D |
topic | Ref |
initialOptions | TopicControllerOptions<AddressOf<D>, Ref> |
Returns
TopicController<Ref>