Observable
public protocol Observable
Represents a changing stream of values that can be observed.
-
The type of value that will be emitted by the observable type.
Declaration
Swift
associatedtype Value
-
Observers are closures that take a single
Element
.Declaration
Swift
typealias Observer = (Value) -> Void
-
Adds a new observer.
Declaration
Swift
func observe(_ observer: @escaping Observer) -> Subscription
Parameters
observer
The observer to be added.
Return Value
A
Subscription
instance.
-
bind(to:keyPath:)
Extension methodUndocumented
Declaration
Swift
public func bind<R>(to object: R, keyPath: ReferenceWritableKeyPath<R, Value>) -> Subscription