Skip to content

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

Interface: TopicsController<ToServer, Ref> ​

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

Type Parameters ​

Type ParameterDefault type
ToServer extends ChanxMessage-
Ref extends TopicRefTopicRef

Properties ​

clearMessages ​

ts
clearMessages: () => void;

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

Returns ​

void


getSnapshot ​

ts
getSnapshot: () => TopicsSnapshot<Ref>;

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

Returns ​

TopicsSnapshot<Ref>


request ​

ts
request: (message, options?) => Promise<ChanxMessage>;

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

Parameters ​

ParameterType
messageToServer
options?RequestOptions

Returns ​

Promise<ChanxMessage>


send ​

ts
send: (message) => void;

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

Send on the channel itself, not on a topic.

Parameters ​

ParameterType
messageToServer

Returns ​

void


sendTopic ​

ts
sendTopic: (topic, message) => void;

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

Send on a joined topic, addressed by its resolved name.

Parameters ​

ParameterType
topicstring
messageToServerOf<Ref>

Returns ​

void


setOptions ​

ts
setOptions: (options) => void;

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

Parameters ​

ParameterType
optionsTopicsControllerOptions<string, Ref>

Returns ​

void


start ​

ts
start: () => void;

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

Returns ​

void


stop ​

ts
stop: () => void;

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

Returns ​

void


subscribe ​

ts
subscribe: (listener) => () => void;

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

Parameters ​

ParameterType
listener() => void

Returns ​

() => void


terminate ​

ts
terminate: (code?, reason?) => void;

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

Parameters ​

ParameterType
code?number
reason?string

Returns ​

void


topicKey ​

ts
readonly topicKey: string;

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

Identity of the topic set, so bindings can restart only when it really changes.


url ​

ts
readonly url: string | null;

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

MIT licensed