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 }
  • The signal that delivers value change events.

    Declaration

    Swift

    var signal: Signal<Value> { get }
  • async() Extension method

    Returns an AsyncReadableProperty that is derived from this synchronous property’s signal.

    Declaration

    Swift

    public func async() -> AsyncReadableProperty<Value>
  • map(_:) Extension method

    Returns a ReadableProperty whose value is derived from this property’s value. The given transform will be applied whenever this property’s value changes.

    Declaration

    Swift

    public func map<U>(_ transform: @escaping (Self.Value) -> U) -> ReadableProperty<U>
  • map(_:) Extension method

    Returns a ReadableProperty whose value is derived from this property’s value. The given transform will be applied whenever this property’s value changes.

    Declaration

    Swift

    public func map<U: Equatable>(_ transform: @escaping (Self.Value) -> U) -> ReadableProperty<U>
  • readable Extension method

    Returns 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 method

    Returns 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 method

    Returns 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