StoreOf<R> is a type alias that simplifies store type declarations by consolidating a reducer’s state and action types into a single generic parameter.
Declaration
Overview
Instead of specifying both state and action types as separate generics,StoreOf allows you to reference a store using only the reducer type. This reduces verbosity and improves readability throughout your SwiftUI views.
Before StoreOf
With StoreOf
Usage
StoreOf is particularly useful in SwiftUI view declarations where you need to accept a store parameter:
Scoping with StoreOf
StoreOf works seamlessly with store scoping operations:
See Also
Store: The underlying store typeReducer: The protocol that defines feature logic