validate static method
Perform a validation against the provided bindings.
Implementation
static Stream<bool> validate(
List<TwoWayBinding<Object>> bindings, {
bool initialValue = false,
}) =>
Rx.combineLatest<Object?, bool>(
bindings.map((binding) => binding.stream),
(values) {
var isValid = true;
values.asMap().forEach((index, value) {
isValid &= value == bindings[index].value;
});
return isValid;
},
).onErrorReturn(false).shareValueSeeded(initialValue).asBroadcastStream();