Combines elements from another publisher 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 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 two upstream publishers.
The returned publisher waits until both publishers have emitted an event, then delivers the oldest unconsumed event from each publisher together as a tuple to the closure. For example, if publisher
P1 emits elements
b, and publisher
P2 emits event
c, the transform closure receives the tuple
(a, c). The closure won’t receive a tuple with event
P2 emits another event. If either upstream publisher finishes successfully or fails with an error, the zipped publisher does the same.