ObservableValue

public class ObservableValue<Value> : ObservableObject

An ObservableValue can be wrapped in an ObservedObjectproperty wrapper. With the given Selector it selects a slice of the State for SwiftUI to automatically observe.

  • The current value. This will change everytime the State in the Store changes

    Declaration

    Swift

    @Published
    public private(set) var current: Value { get set }
  • Initializes the ObservableValue with a Selector and the Store from where to select.

    Declaration

    Swift

    public init<State, Environment>(store: Store<State, Environment>, selector: Selector<State, Value>)

    Parameters

    store

    The Store to select from

    selector

    The Selectors to use for selecting