Store

  • The Store is a centralized container for a single-source-of-truth State.

    A Store is configured by registering all the desired Reducers and Effects.

    An Environment can be set up to enable dependency injection in Effects.

    Usage

    To update the State callers dispatch Actions on the Store.

    Selecting

    To select a value in the State the callers can either use a Selector or a key path. It is possible to get a Publisher for the value or just to select the current value.

    Interceptors

    It is possible to intercept all Actions and State changes by registering an Interceptor.

    See more

    Declaration

    Swift

    open class Store<State, Environment> : ObservableObject
    extension Store: Subscriber