@pond-ts/charts API Reference
    Preparing search index...

    Interface LiveValue

    A live scalar an axis indicator subscribes to, pushed imperatively from outside React — a WebSocket onmessage, a requestAnimationFrame loop, a tick handler. Backed by useSyncExternalStore on the consuming indicator: calling LiveValue.set re-renders only the indicators subscribed to this value — never the chart tree, never a canvas repaint. This is the path for a value that ticks many times a second (a live last-price tag), set independently of the series' own last point.

    Create one with createLiveValue and pass it to <YAxisIndicator source={…}>.

    interface LiveValue {
        getSnapshot(): number;
        set(value: number): void;
        subscribe(onStoreChange: () => void): () => void;
    }
    Index

    Methods

    • Internal

      Current value snapshot, for useSyncExternalStore.

      Returns number

    • Push a new value. Re-renders subscribed indicators only; a no-op if the value is unchanged. Safe to call from outside React at any frequency.

      Parameters

      • value: number

      Returns void

    • Internal

      Store subscribe, for useSyncExternalStore.

      Parameters

      • onStoreChange: () => void

      Returns () => void