Skip to content

API reference > @kontsedal/olas-realtime > LiveStream

LiveStream type ​

Live-streaming buffer over a single realtime channel. Pause/resume controls the subscription (not the buffer — already-buffered events are preserved across a pause). **Events that arrive DURING a pause are lost:**pause() tears down the underlying subscription, so nothing is received (let alone buffered) until resume(). To recover a gap, pair withonReconnect(...) + a query invalidate (refetch authoritative state) rather than relying on the buffer. clear() empties the buffer without touching the subscription. A channel signal's change empties it too, since the buffered events came from the old channel. SPEC §16.5 tail-buffer pattern.

Signature:

typescript
export type LiveStream<TEvent> = {
  events: ReadSignal<readonly TEvent[]>;
  isPaused: ReadSignal<boolean>;
  pause(): void;
  resume(): void;
  clear(): void;
};

References: ReadSignal

Released under the MIT License.