Skip to content

SubscribeOptions

SubscribeOptions<TResult> = object

Defined in: packages/@livestore/livestore/src/store/store-types.ts:286

Options for store.subscribe().

TResult

The result type of the subscribed query

optional label: string

Defined in: packages/@livestore/livestore/src/store/store-types.ts:292

Label for debugging and devtools


optional onSubscribe: (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)

LiveQuery<TResult>

void


optional onUnsubsubscribe: () => void

Defined in: packages/@livestore/livestore/src/store/store-types.ts:290

Callback invoked when the subscription is terminated

void


optional otelContext: otel.Context

Defined in: packages/@livestore/livestore/src/store/store-types.ts:296

OpenTelemetry context for tracing


optional skipInitialRun: boolean

Defined in: packages/@livestore/livestore/src/store/store-types.ts:294

If true, skips invoking the callback for the initial value


optional stackInfo: StackInfo

Defined in: packages/@livestore/livestore/src/store/store-types.ts:298

Stack trace info for debugging subscription origins