Skip to content

SubscribeOptions

SubscribeOptions<TResult> = object

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

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:298

Label for debugging and devtools


optional onSubscribe: (query$) => void

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

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:296

Callback invoked when the subscription is terminated

void


optional otelContext: otel.Context

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

OpenTelemetry context for tracing


optional skipInitialRun: boolean

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

If true, skips invoking the callback for the initial value


optional stackInfo: StackInfo

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

Stack trace info for debugging subscription origins