Skip to content

LifecycleSlot

Defined in: packages/client/src/lifecycle-slot.ts:32

A single-occupancy lifecycle slot. One owner per store (createSyncClient); one operation at a time.

isBusy: () => boolean

Defined in: packages/client/src/lifecycle-slot.ts:42

Whether an operation currently holds the slot.

boolean


run: <T>(label, fn) => Promise<T>

Defined in: packages/client/src/lifecycle-slot.ts:40

Run fn under the slot’s exclusion. Rejects with a LifecycleBusyError — without invoking fn — if the slot is already occupied; otherwise holds the slot for fn’s lifetime and releases it in a finally, so a throwing operation never leaves the slot stuck. The occupancy check + claim run synchronously on entry (before the first await), so two calls issued in the same tick resolve deterministically: the first claims, the second is refused.

T

string

() => Promise<T>

Promise<T>


runningLabel: () => string | null

Defined in: packages/client/src/lifecycle-slot.ts:44

The label of the operation currently holding the slot, or null when free.

string | null