Subscribable
public protocol Subscribable<Element>
A type that can be subscribed to by an Observer to receive elements and completion.
-
Undocumented
Declaration
Swift
associatedtype Element -
Subscribes an
Observerto receive elements and completion.Declaration
Swift
@discardableResult func subscribe<O>(_ observer: O) -> any Disposable where O : Observer, Self.Element == O.ElementReturn Value
A
Disposablerepresenting the subscription. Disposing it stops event delivery. -
subscribe(_:Extension methodonComplete: ) Subscribe a callback to receive the
Element.Declaration
Swift
@discardableResult func subscribe(_ onNext: @escaping (Element) -> Void, onComplete: @escaping () -> Void = { }) -> any DisposableParameters
onNextThe callback called with the
Element.onCompleteThe callback called once when the upstream source completes. Not invoked on external disposal.
Return Value
A
Disposablethat can be disposed to stop the observer from being called.
View on GitHub