Explores where loading state should live in SwiftUI apps, comparing three approaches: keeping it as a local view @State property, embedding it in a generic enum with associated data, or moving it into the store. The author argues that separating loading phase (in the view) from data (in the store) avoids duplicating state and keeps the store as a single source of truth. Concrete code examples show how the success(T) approach and store-based loading state both introduce complexity, especially when handling mutations like addProduct.

10m read timeFrom azamsharp.com
Post cover image
583 Impressions