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

    Function useLatest

    • Subscribe to a live source and return only the latest event.

      Many dashboard stats only need the most recent value — current CPU, latest count, last price. Building a full TimeSeries snapshot for a single event is wasteful. useLatest returns just the last event, throttled like useSnapshot:

      const latest = useLatest(live);
      // latest?.get('cpu') → number

      Returns null when the source is empty or null.

      Type Parameters

      • S extends SeriesSchema

      Parameters

      Returns EventForSchema<S> | null