ResStream<S, F>.fromResults constructor

ResStream<S, F>.fromResults(
  1. Iterable<Res<S, F>> results
)

Creates a result stream that emits the given results in order, then closes. For stubbing in tests:

when(() => weatherApi.watchTemperature(any())).thenReturn(
  ResultStream.fromResults([
    const Success(21.5),
    const Failure(WeatherError.offline),
  ]),
);

Implementation

ResStream.fromResults(Iterable<Res<S, F>> results)
  : this._(t.ResultStream.fromResults(results as Iterable<Result<S, F>>));