ReadablePropertyType
public protocol ReadablePropertyType : AnyObject
Represents a property, which exposes a value and allows observers to see when that value has changed.
-
The property’s value type.
Declaration
Swift
associatedtype Value -
The value exposed by this property.
Declaration
Swift
var value: Value { get }
-
async()Extension methodReturns an AsyncReadableProperty that is derived from this synchronous property’s signal.
Declaration
Swift
public func async() -> AsyncReadableProperty<Value>
-
map(_:)Extension methodReturns a ReadableProperty whose value is derived from this property’s
value. The giventransformwill be applied whenever this property’s value changes.Declaration
Swift
public func map<U>(_ transform: @escaping (Self.Value) -> U) -> ReadableProperty<U> -
map(_:)Extension methodReturns a ReadableProperty whose value is derived from this property’s
value. The giventransformwill be applied whenever this property’s value changes.Declaration
Swift
public func map<U: Equatable>(_ transform: @escaping (Self.Value) -> U) -> ReadableProperty<U> -
readableExtension methodReturns a ReadableProperty with the same type and value. Useful for hiding the original property type.
Declaration
Swift
public var readable: ReadableProperty<Value> { get }
-
or(_:)Extension methodReturns a ReadableProperty whose value resolves to
self.value || other.value. The returned property’s value will be recomputed any time the value of either input changes.Declaration
Swift
public func or<P>(_ other: P) -> ReadableProperty<Bool> where P : ReadablePropertyType, P.Value == Bool -
and(_:)Extension methodReturns a ReadableProperty whose value resolves to
self.value && other.value. The returned property’s value will be recomputed any time the value of either input changes.Declaration
Swift
public func and<P>(_ other: P) -> ReadableProperty<Bool> where P : ReadablePropertyType, P.Value == Bool
ReadablePropertyType Protocol Reference