Generic Instance Method

zip(_:_:)

Combines elements from another publisher and delivers a transformed output.

Declaration

func zip<P, T>(_ other: P, _ transform: @escaping (Output, P.Output) -> T) -> Publishers.Map<Publishers.Zip<Record<Output, Failure>, P>, T> where P : Publisher, Self.Failure == P.Failure

Parameters

other

Another 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 two upstream publishers.