combineLatest4<R, A, B, C, D> function

EventSubscriptionBuilder<R> combineLatest4<R, A, B, C, D>(
  1. EventSubscriptionBuilder<A> eventA,
  2. EventSubscriptionBuilder<B> eventB,
  3. EventSubscriptionBuilder<C> eventC,
  4. EventSubscriptionBuilder<D> eventD,
  5. R combinator(
    1. A a,
    2. B b,
    3. C c,
    4. D d,
    ),
)

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

See combineLatest.

Implementation

EventSubscriptionBuilder<R> combineLatest4<R, A, B, C, D>(
  EventSubscriptionBuilder<A> eventA,
  EventSubscriptionBuilder<B> eventB,
  EventSubscriptionBuilder<C> eventC,
  EventSubscriptionBuilder<D> eventD,
  R Function(A a, B b, C c, D d) combinator,
) {
  return combineLatest(
    [eventA, eventB, eventC, eventD],
    (values) {
      final a = values[0] as A;
      final b = values[1] as B;
      final c = values[2] as C;
      final d = values[3] as D;

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