Skip to content

ntcore-ts / @ntcore-ts/react / UseTopicResult

Type Alias: UseTopicResult<T> ​

UseTopicResult<T> = object

Defined in: react/src/lib/use-topic.ts:42

Result of useTopic. When you pass publish, setValue is defined and you must wait for isReadyToWrite before calling it.

Type Parameters ​

T ​

T = NetworkTablesTypes

Properties ​

error ​

error: Error | null

Defined in: react/src/lib/use-topic.ts:49

Last publish or setValue error, if any.


isReadyToWrite ​

isReadyToWrite: boolean

Defined in: react/src/lib/use-topic.ts:47

True once the server has acknowledged our publish request. Only check this when you passed publish.


setValue ​

setValue: ((value) => void) | undefined

Defined in: react/src/lib/use-topic.ts:45


value ​

value: ReadonlyValue<T> | null

Defined in: react/src/lib/use-topic.ts:44

Shared with every subscriber of the topic, so it is read-only.

Released under the MIT License.