combine<R, B> method

  1. @override
SReadOnlyState<R> combine<R, B>(
  1. SBaseState<B> other,
  2. SCombinerSingleFunction<R, T, B> transformer
)
inherited

Implementation

@override
SReadOnlyState<R> combine<R,B>(SBaseState<B> other, SCombinerSingleFunction<R, T,B> transformer) {
  var t = _CombinerStream.combineTwo(this, other, (current, other) {
    return transformer(current, other);
  });
  var initial =
      (valueOrNull != null && other.valueOrNull != null) ? transformer(valueOrNull as T, other.valueOrNull as B) : null;
  return SReadOnlyState._fromStream(t.stream, initial);
}