combineLatest2<R, A, B> function

EventSubscriptionBuilder<R> combineLatest2<R, A, B>(
  1. EventSubscriptionBuilder<A> eventA,
  2. EventSubscriptionBuilder<B> eventB,
  3. R combinator(
    1. A a,
    2. B b
    )
)

Combines the latest values of each provided event using the combinator into a single output EventHandler.

See combineLatest.

Implementation

EventSubscriptionBuilder<R> combineLatest2<R, A, B>(
  EventSubscriptionBuilder<A> eventA,
  EventSubscriptionBuilder<B> eventB,
  R Function(A a, B b) combinator,
) {
  return combineLatest(
    [eventA, eventB],
    (values) {
      final a = values[0] as A;
      final b = values[1] as B;

      return combinator(a, b);
    },
  );
}