zip4<B, C, D, Z> method

LoadingState<Z> zip4<B, C, D, Z>(
  1. LoadingState<B> state2,
  2. LoadingState<C> state3,
  3. LoadingState<D> state4,
  4. Z transform(
    1. A rawContent1,
    2. B rawContent2,
    3. C rawContent3,
    4. D rawContent4,
    ),
)

Implementation

LoadingState<Z> zip4<B, C, D, Z>(LoadingState<B> state2, LoadingState<C> state3, LoadingState<D> state4, Z Function(A rawContent1, B rawContent2, C rawContent3, D rawContent4) transform) {
  return zip2(state2, (rawContent, B other) {
    return Tuple2(rawContent, other);
  }).zip2(state3, (rawContent, C other) {
    return Tuple3(rawContent.item1, rawContent.item2, other);
  }).zip2(state4, (rawContent, D other) {
    return transform(rawContent.item1, rawContent.item2, rawContent.item3, other);
  });
}