Skip to content

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

Interface: UseTopicResult<T> ​

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

Type Parameters ​

Type Parameter
T extends TopicRef

Properties ​

clearMessages ​

ts
clearMessages: () => void;

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

Returns ​

void


close ​

ts
close: () => void;

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

Returns ​

void


handle ​

ts
handle: Ref<
  | TopicHandle<ToServerOf<T>, ToClientOf<T>>
| null>;

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

The topic's handle while joined.


lastMessage ​

ts
lastMessage: Ref<TopicMessage<T> | null>;

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


messages ​

ts
messages: Ref<TopicMessage<T>[]>;

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


request ​

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

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

Send on the topic and wait for the reply carrying the same ref.

Parameters ​

ParameterType
messageToServerOf<T>
options?RequestOptions

Returns ​

Promise<ChanxMessage>


send ​

ts
send: (message) => void;

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

Send on the topic.

Parameters ​

ParameterType
messageToServerOf<T>

Returns ​

void


status ​

ts
status: Ref<SocketStatus>;

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


subscribed ​

ts
subscribed: Ref<boolean>;

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


terminate ​

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

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

Parameters ​

ParameterType
code?number
reason?string

Returns ​

void

MIT licensed