bindDataRule2<S> method

TwoWayBinding<T> bindDataRule2<S>(
  1. TwoWayBinding<S> second,
  2. DataRule<(T?, S?), T> rule
)

Add a new data rule, combined with another TwoWayBinding.

Implementation

TwoWayBinding<T> bindDataRule2<S>(
  TwoWayBinding<S> second,
  DataRule<(T?, S?), T> rule,
) {
  _stream = Rx.combineLatest2<T?, S?, (T?, S?)>(
    _stream,
    second._stream,
    (first, second) => (first, second),
  ).map((data) {
    _value = data.$1;
    _value = rule.process(data);
    return _value;
  }).shareValue();

  return this;
}