Generic Structure
Publishers .Try Reduce A publisher that applies an error-throwing closure to all received elements and produces an accumulated value when the upstream publisher finishes.
SDKs
iOS 13.0+ macOS 10.15+ Mac Catalyst 13.0+ tvOS 13.0+ watchOS 6.0+ Xcode 11.0+ Declaration struct TryReduce <Upstream , Output > where Upstream : Publisher
Topics
Instance Methods func combine Latest <P, Q, T>(P, Q, (Output, P .Output, Q .Output) -> T) -> Publishers .Map<Publishers .Combine Latest3<Publishers .Try Reduce<Upstream, Output>, P, Q>, T>
Subscribes to two additional publishers and invokes a closure upon receiving output from any of the publishers.
func combine Latest <P, Q, R, T>(P, Q, R, (Output, P .Output, Q .Output, R .Output) -> T) -> Publishers .Map<Publishers .Combine Latest4<Publishers .Try Reduce<Upstream, Output>, P, Q, R>, T>
Subscribes to three additional publishers and invokes a closure upon receiving output from any of the publishers.
func map <T0, T1, T2>(Key Path<Output, T0>, Key Path<Output, T1>, Key Path<Output, T2>) -> Publishers .Map Key Path3<Publishers .Try Reduce<Upstream, Output>, T0, T1, T2>
Publishes the values of three key paths as a tuple.
func merge <B, C, D, E>( with : B, C, D, E) -> Publishers .Merge5<Publishers .Try Reduce<Upstream, Output>, B, C, D, E>
Combines elements from this publisher with those from four other publishers, delivering an interleaved sequence of elements.
func merge <B, C, D, E, F>( with : B, C, D, E, F) -> Publishers .Merge6<Publishers .Try Reduce<Upstream, Output>, B, C, D, E, F>
Combines elements from this publisher with those from five other publishers, delivering an interleaved sequence of elements.
func merge <B, C, D, E, F, G>( with : B, C, D, E, F, G) -> Publishers .Merge7<Publishers .Try Reduce<Upstream, Output>, B, C, D, E, F, G>
Combines elements from this publisher with those from six other publishers, delivering an interleaved sequence of elements.
func merge <B, C, D, E, F, G, H>( with : B, C, D, E, F, G, H) -> Publishers .Merge8<Publishers .Try Reduce<Upstream, Output>, B, C, D, E, F, G, H>
Combines elements from this publisher with those from seven other publishers, delivering an interleaved sequence of elements.
func zip <P, Q, T>(P, Q, (Output, P .Output, Q .Output) -> T) -> Publishers .Map<Publishers .Zip3<Publishers .Try Reduce<Upstream, Output>, P, Q>, T>
Combines elements from two other publishers and delivers a transformed output.
func zip <P, Q, R, T>(P, Q, R, (Output, P .Output, Q .Output, R .Output) -> T) -> Publishers .Map<Publishers .Zip4<Publishers .Try Reduce<Upstream, Output>, P, Q, R>, T>
Combines elements from three other publishers and delivers a transformed output.
See Also
Reducing Elements struct Publishers .Reduce
A publisher that applies a closure to all received elements and produces an accumulated value when the upstream publisher finishes.