combinedUnresolved<R, O> method

ValueStream<R?> combinedUnresolved<R, O>(
  1. ValueStream<O> other,
  2. Resolvable<R?> combiner(
    1. FutureOr<T?> self,
    2. FutureOr<O?> other
    )
)

Combines another stream, passing unresolved Futures

Implementation

ValueStream<R?> combinedUnresolved<R, O>(ValueStream<O> other, Resolvable<R?> combiner(FutureOr<T?> self, FutureOr<O?> other)) {
  final Resolvable<R?> startCombined = combiner(this.get(), other.get());
  final Stream<R?> startingStream = startCombined.isResolved ? Stream.empty() : startCombined.futureValue().asStream();
  final afterTxr = this.after.combineLatest(other.after, (T t, O o) {
    final resolved = combiner(t, o);
    return resolved.resolveOrNull();
  });
  return ValueStream<R?>.of(startCombined.resolveOrNull(), startingStream.combine(afterTxr));
}