useStream<T> function

AsyncSnapshot<T> useStream <T>(Stream<T> stream, { T initialData, bool preserveState: true })

Subscribes to a Stream and return its current state in an AsyncSnapshot.

See also:

Implementation

AsyncSnapshot<T> useStream<T>(Stream<T> stream,
    {T initialData, bool preserveState = true}) {
  return Hook.use(_StreamHook(
    stream,
    initialData: initialData,
    preserveState: preserveState,
  ));
}