Observer
public protocol Observer<Element>
A protocol representing an observer that can receive elements and a completion signal.
Contract:
onNext(_:)may be called zero or more times.onComplete()is called at most once, always after allonNextcalls.- After
onComplete(), no furtheronNextcalls will be made. onComplete()is NOT called upon external disposal — only on natural upstream termination.
-
Undocumented
Declaration
Swift
associatedtype Element -
Called when the upstream source emits a new element.
Declaration
Swift
func onNext(_ element: Element) -
Called once when the upstream source has terminated. No further
onNextcalls will follow.Declaration
Swift
func onComplete()
View on GitHub