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:
constlatest=useLatest(live); // latest?.get('cpu') → number
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
TimeSeriessnapshot for a single event is wasteful.useLatestreturns just the last event, throttled likeuseSnapshot:Returns
nullwhen the source is empty ornull.