PerformanceTracker and Architecture #2522
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
TCA encourages the practice of using dependencies within a reducer to ensure the whole structure comprises a single entry-point system (https://pointfreeco.github.io/swift-dependencies/main/documentation/dependencies/singleentrypointsystems/). This is to ensure that if you overwrite a dependency at the top-level of your app, it will propagate down to any view (assuming all views are powered by some sort of store and dependencies are accessed there). From what I've seen, I think the answer you're going to get is something to the extent of having .onAppear send an action to store and then in your reducer's action, you'd make that call you're doing in the initializer. Hopefully I'm not providing completely incorrect information, others can chime in if I'm wrong :) |
Beta Was this translation helpful? Give feedback.
-
Hi @Alex0Klain, you definitely do not want to instrument a view's |
Beta Was this translation helpful? Give feedback.
TCA encourages the practice of using dependencies within a reducer to ensure the whole structure comprises a single entry-point system (https://pointfreeco.github.io/swift-dependencies/main/documentation/dependencies/singleentrypointsystems/). This is to ensure that if you overwrite a dependency at the top-level of your app, it will propagate down to any view (assuming all views are powered by some sort of store and dependencies are accessed there).
From what I've seen, I think the answer you're going to get is something to the extent of having .onAppear send an action to store and then in your reducer's action, you'd make that call you're doing in the initializer. Hopefully I'm not provi…