combineWith<U, R> method

ComputedObservable<R> combineWith<U, R>(
  1. Observable<U> other,
  2. R combiner(
    1. T,
    2. U
    ), {
  3. EqualityFunction<R>? equals,
  4. ErrorCallback? onError,
})

Creates a new ComputedObservable that depends on this one and additional observables.

Implementation

ComputedObservable<R> combineWith<U, R>(
  Observable<U> other,
  R Function(T, U) combiner, {
  EqualityFunction<R>? equals,
  ErrorCallback? onError,
}) {
  throwIfDisposed('combineWith');
  return ComputedObservable<R>(
    () => combiner(value, other.value),
    [..._dependencies, other],
    equals: equals,
    onError: onError,
  );
}