Combines elements from two other publishers and delivers a transformed output.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
A second publisher.
A third publisher.
A closure that receives the most-recent value from each publisher and returns a new value to publish.
A publisher that uses the
transform closure to emit new elements, produced by combining the most recent value from three upstream publishers.
zip(_: to return a new publisher that combines the elements from two other publishers using a transformation you specify to publish a new value to the downstream subscriber. The returned publisher waits until all three publishers have emitted an event, then delivers the oldest unconsumed event from each publisher together that the operator uses in the transformation.
In this example,
emoji are each a
Passthrough that emit values;
zip(_: receives the oldest value from each publisher and uses the
numbers and publishes a string that repeats the
emoji that many times.
If any upstream publisher finishes successfully or fails with an error, the zipped publisher does the same.