ObservableType
extension ObservableType
-
A bridging operator that transforms an RxSwift
ObservableTypeinto a CombinePublisher.Note: A legal combine
Publishermust limit its production to the level specified by aSubscriberwhereas an RxSwiftObservablehas no such restriction. Therefore, this operator maintains a buffer of elements from the upstreamObservableto store until requested.To avoid out-of-memory errors, and constrain resource usage in general, it is recommended to provide a conservative value for
bufferSizematching the expected output of the upstreamObservableand consumption of the downstreamSubscriber.Declaration
Swift
public func bridgeToCombine(bufferSize: Int, whenFull: RxBridgeBufferingStrategy = .fail) -> Publishers.Buffer<RxBridge<Self>>Parameters
bufferSizeThe size of the element buffer.
whenFullThe strategy to employ for handling subsequent elements if the buffer reaches capacity
View on GitHub
ObservableType Extension Reference