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

    Function useLiveVersion

    • The React change signal for reading columns off a live source without manufacturing a TimeSeries snapshot (§A pull/read, experimental).

      LiveSeries / LiveView mutate in place, so a useMemo([liveView]) keyed on the view never re-runs. This hook gives React a monotonically-increasing version that changes (at most once per throttle) whenever the source mutates — the missing invalidation trigger. Read columns straight off the live view, keyed on the returned version:

      const view = useMemo(() => live.window('5m'), [live]);
      const v = useLiveVersion(view, { throttle: 200 });
      const series = useMemo(
      () => view.partitionBy('host').toMap((g) => ({
      ts: g.keyColumn().begin,
      cpu: g.column('cpu').toFloat64Array(),
      })),
      [view, v],
      );

      Tracks both append ('event') and eviction ('evict', on sources that emit it — e.g. clear() / retention prune), and advances the revision on subscribe so a change between render and the subscribe effect is still picked up (the useSyncExternalStore post-subscribe re-read). Experimental (0.19.0) — surface may change in 0.19.x.

      Type Parameters

      • S extends SeriesSchema

      Parameters

      Returns number