fromStream<T> static method

Stream<LateResult<T>> fromStream<T>(
  1. Stream<T> stream
)

Implementation

static Stream<LateResult<T>> fromStream<T>(Stream<T> stream) async* {
  yield Late<T>.pending();

  try {
    await for (final value in stream) {
      yield Late.success(value);
    }
  } catch (e, s) {
    yield Late.failure(e, s);
  }
}