Generic Instance Method

combineLatest(_:_:_:)

Subscribes to two additional publishers and invokes a closure upon receiving output from any of the publishers.

Declaration

func combineLatest<P, Q, T>(_ publisher1: P, _ publisher2: Q, _ transform: @escaping (Upstream.Output, P.Output, Q.Output) -> T) -> Publishers.Map<Publishers.CombineLatest3<Publishers.SetFailureType<Upstream, Failure>, P, Q>, T> where P : Publisher, Q : Publisher, Self.Failure == P.Failure, P.Failure == Q.Failure

Parameters

publisher1

A second publisher to combine with this one.

publisher2

A third publisher to combine with this one.

transform

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

Return Value

A publisher that receives and combines elements from this publisher and two other publishers.