Skip to content

Documentation / @super-store/store / StoreValueOptions

Interface: StoreValueOptions<T, M>

Defined in: store-value.ts:139

Type Parameters

T

T

M

M extends StoreMode = "shallow"

Properties

debug?

optional debug?: boolean

Defined in: store-value.ts:142


doc?

optional doc?: Doc

Defined in: store-value.ts:146

Inject a Yjs document to persist/sync this store. Attach providers (y-indexeddb, y-websocket, …) to this doc yourself. Omit for a private in-memory doc that is created lazily on first Yjs access.


isEqual?

optional isEqual?: (a, b) => boolean

Defined in: store-value.ts:140

Parameters

a

T

b

T

Returns

boolean


mode?

optional mode?: M

Defined in: store-value.ts:156

"document" makes this a recursive CRDT document: plain nested objects map to nested Y.Map, plain nested arrays to Y.Array (element-opaque), so concurrent edits to different fields of the same nested object merge instead of clobbering. Reads stay plain JSON. Default "shallow" — top-level keys only, nested values opaque.


name?

optional name?: string

Defined in: store-value.ts:141


opaque?

optional opaque?: string[]

Defined in: store-value.ts:161

Document-mode only. Path globs whose subtrees stay atomic single cells (whole-value LWW), e.g. ["elements.*.value", "state"]. * matches one segment. Required for discriminated-union subtrees, where field-merge corrupts. Must be identical across all peers (see DESIGN §4).


undo?

optional undo?: boolean | { captureTimeout?: number; }

Defined in: store-value.ts:150

Track local writes for undo/redo. true (or an options object) attaches a Yjs UndoManager scoped to this root, tracking only this store's own writes. Off by default — UndoManager pins deleted content and disables GC.

Released under the MIT License.