Generic Instance Method

zip(_:_:_:)

Combines elements from two other publishers and delivers a transformed output.

Declaration

func zip<P, Q, T>(_ publisher1: P, _ publisher2: Q, _ transform: @escaping ((Output0, Output1), P.Output, Q.Output) -> T) -> Publishers.Map<Publishers.Zip3<Publishers.MapKeyPath2<Upstream, Output0, Output1>, P, Q>, T> where P : Publisher, Q : Publisher, Self.Failure == P.Failure, P.Failure == Q.Failure

Parameters

publisher1

A second publisher.

publisher2

A third publisher.

transform

A closure that receives the most recent value from each publisher and returns a new value to publish.

Return Value

A publisher that uses the transform closure to emit new elements, produced by combining the most recent value from three upstream publishers.