Skip to main content

Interface: SelectionStore<Row>

Defined in: packages/sdvplot/src/selection.ts:53

The linked-interactivity hub that createSelection returns.

Type Parameters​

Row​

Row = unknown

Methods​

clear()​

clear(): void

Defined in: packages/sdvplot/src/selection.ts:59

Clear hover, selected, predicate and cursor.

Returns​

void


getState()​

getState(): SelectionState<Row>

Defined in: packages/sdvplot/src/selection.ts:55

Referentially stable until the next change: what useSyncExternalStore reads.

Returns​

SelectionState<Row>


set()​

set(patch): void

Defined in: packages/sdvplot/src/selection.ts:57

Apply a patch. ONE notification when anything changed, none when nothing did, so linked components cannot ping-pong.

Parameters​

patch​

SelectionPatch<Row>

Returns​

void


subscribe()​

subscribe(fn): () => void

Defined in: packages/sdvplot/src/selection.ts:66

Call fn after every change; returns the unsubscribe function. A listener that throws stops neither the others nor set: its error is rethrown in a microtask, as an EventTarget listener's is, so it still reaches window.onerror (or Node's uncaughtException) but one broken view cannot freeze the rest. A listener removed during a notification is not called for it.

Parameters​

fn​

(state) => void

Returns​

() => void