ViewState and ViewAction #152
-
Hello, Thank you for this amazing project, I am trying to replicate your work in my personal project. I just have a question regarding |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@ibrahimkteish Scoping a view store's state (e.g., to We talked about it most recently in this episode: https://www.pointfree.co/episodes/ep151-composable-architecture-performance-view-stores-and-scoping And we developed the concept here: https://www.pointfree.co/episodes/ep95-adaptive-state-management-state
https://www.pointfree.co/episodes/ep96-adaptive-state-management-actions |
Beta Was this translation helpful? Give feedback.
@ibrahimkteish Scoping a view store's state (e.g., to
ViewState
) is important to avoid recomputing the view hierarchy too often. SwiftUI observes the view store as anObservableObject
based on its state. If you don't scope the view store to just the state a given view needs, performance may suffer, especially in the outer layers of your app, where more global state is available to your store. In isowords you'll see that most of our scoping toViewState
occurs in the outer layers of the app. At leaf views that don't pass the store any further, we are less apt to need to scope.We talked about it most recently in this episode: https://www.pointfree.co/episodes/ep151-composable-architecture-…