Rezi
    Preparing search index...

    Function useStream

    • Subscribe to an async iterable and re-render on each value.

      • Sets loading while waiting for the first value
      • Stores the latest stream item in value
      • Sets done when iteration completes
      • Ignores stale values if a newer subscription replaces the stream

      Type Parameters

      • T

      Parameters

      • ctx: StreamHookContext
      • stream: AsyncIterable<T, any, any> | undefined
      • Optionaldeps: readonly unknown[]

      Returns UseStreamState<T>