ntcore-ts / @ntcore-ts/react / UseProtobufTopicOptions
Type Alias: UseProtobufTopicOptions<T>
UseProtobufTopicOptions<
T> =object
Defined in: react/src/lib/use-protobuf-topic.ts:12
Options for useProtobufTopic (defaultValue, validator, protoFilePath, protoSource, messageType, subscribeOptions, publish). validator is a Zod schema for the decoded message type.
Type Parameters
T
T extends object
Properties
defaultValue?
optionaldefaultValue?:T
Defined in: react/src/lib/use-protobuf-topic.ts:13
messageType?
optionalmessageType?:Type
Defined in: react/src/lib/use-protobuf-topic.ts:17
protoFilePath?
optionalprotoFilePath?:string
Defined in: react/src/lib/use-protobuf-topic.ts:15
protoSource?
optionalprotoSource?:string
Defined in: react/src/lib/use-protobuf-topic.ts:16
publish?
optionalpublish?:true|TopicProperties
Defined in: react/src/lib/use-protobuf-topic.ts:25
Make this client the publisher of the topic so you can write with setValue.
true→ publish with default properties (not retained).{ retained: true }(or other TopicProperties) → publish with those properties. When provided, only call setValue after isReadyToWrite is true.
subscribeOptions?
optionalsubscribeOptions?:SubscribeOptions
Defined in: react/src/lib/use-protobuf-topic.ts:18
unpublishOnUnmount?
optionalunpublishOnUnmount?:boolean
Defined in: react/src/lib/use-protobuf-topic.ts:27
When publish is set, call topic.unpublish() on unmount (default true).
validator?
optionalvalidator?:ZodType<T>
Defined in: react/src/lib/use-protobuf-topic.ts:14