useStream<T> function

AsyncSnapshot<T> useStream <T>(
  1. Stream<T> stream,
  2. {T initialData,
  3. 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 use(_StreamHook(
    stream,
    initialData: initialData,
    preserveState: preserveState,
  ));
}