SubscribeOptions
SubscribeOptions<
TResult> =object
Defined in: packages/@livestore/livestore/src/store/store-types.ts:286
Options for store.subscribe().
Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult
The result type of the subscribed query
Properties
Section titled “Properties”label?
Section titled “label?”
optionallabel:string
Defined in: packages/@livestore/livestore/src/store/store-types.ts:292
Label for debugging and devtools
onSubscribe()?
Section titled “onSubscribe()?”
optionalonSubscribe: (query$) =>void
Defined in: packages/@livestore/livestore/src/store/store-types.ts:288
Callback invoked when the subscription is established (receives the live query instance)
Parameters
Section titled “Parameters”query$
Section titled “query$”LiveQuery<TResult>
Returns
Section titled “Returns”void
onUnsubsubscribe()?
Section titled “onUnsubsubscribe()?”
optionalonUnsubsubscribe: () =>void
Defined in: packages/@livestore/livestore/src/store/store-types.ts:290
Callback invoked when the subscription is terminated
Returns
Section titled “Returns”void
otelContext?
Section titled “otelContext?”
optionalotelContext:otel.Context
Defined in: packages/@livestore/livestore/src/store/store-types.ts:296
OpenTelemetry context for tracing
skipInitialRun?
Section titled “skipInitialRun?”
optionalskipInitialRun:boolean
Defined in: packages/@livestore/livestore/src/store/store-types.ts:294
If true, skips invoking the callback for the initial value
stackInfo?
Section titled “stackInfo?”
optionalstackInfo:StackInfo
Defined in: packages/@livestore/livestore/src/store/store-types.ts:298
Stack trace info for debugging subscription origins