Skip to content

Documentation / @super-line/client / ResourceHandle

Interface: ResourceHandle

Defined in: index.ts:97

A reactive handle over one opened Store Resource (mirrors super-store's StoreValue surface). data is untyped — stores are off-contract (ADR-0003). set/update mutate the local replica and write the resulting Change through to the server.

Properties

ready

readonly ready: Promise<void>

Defined in: index.ts:107

Resolves once the catch-up snapshot has been applied; rejects if the open is denied.

Methods

close()

close(): void

Defined in: index.ts:109

Stop receiving changes and tell the server to unsubscribe.

Returns

void


getSnapshot()

getSnapshot(): unknown

Defined in: index.ts:99

The current snapshot (undefined until the catch-up snapshot arrives).

Returns

unknown


set()

set(data): void

Defined in: index.ts:103

Replace the value (LWW) or mutate the local doc (CRDT); the Change is sent to the server.

Parameters

data

unknown

Returns

void


subscribe()

subscribe(cb): () => void

Defined in: index.ts:101

Subscribe to changes (local writes + remote merges). Returns an unsubscribe fn.

Parameters

cb

() => void

Returns

() => void


update()

update(partial): void

Defined in: index.ts:105

Merge a partial update; the Change is sent to the server.

Parameters

partial

unknown

Returns

void

Released under the MIT License.