Skip to content
EliteChart

ChartHandleStore

Documentation


Documentation / @elitechart/react / ChartHandleStore

Defined in: react/src/types.ts:60

Tiny pub/sub store that backs ChartRef.

<Chart /> writes the handle here on mount + clears it on unmount; useChart subscribes via useSyncExternalStore so child renders react to the mount transition without prop drilling.

Internal — exported only so the type can flow through the public ChartRef shape.

Methods

get()

code
get(): ChartHandle | null;

Defined in: react/src/types.ts:62

Current handle, or null before mount / after unmount.

Returns

ChartHandle | null


subscribe()

code
subscribe(listener): () => void;

Defined in: react/src/types.ts:64

Subscribe to handle changes; returns an unsubscribe.

Parameters

listener

() => void

Returns

() => void