StoreProxy

public struct StoreProxy<State> where State : Decodable, State : Encodable

Creates a proxy of the store object for use by middleware.

Middleware may use the store proxy to retreive the current state, send actions, continue to the next middleware, or subscribe to store changes. With the proxy, middleware don’t have to worry about retaining the store. Instead, the proxy provides a safe API to access a weak reference to it.

  • Subscribe to state changes.

    Declaration

    Swift

    public var didChange: PassthroughSubject<Action, Never>
  • Send an action to the store.

    Declaration

    Swift

    public var send: SendAction
  • Send an action to the next middleware

    Declaration

    Swift

    public var next: SendAction
  • Retrieves the latest state from the store.

    Declaration

    Swift

    public var state: State? { get }