Skip to content
Discussion options

You must be logged in to vote

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…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@Alex0Klain
Comment options

@acosmicflamingo
Comment options

Answer selected by Alex0Klain
Comment options

You must be logged in to vote
4 replies
@Alex0Klain
Comment options

@mbrandonw
Comment options

@Alex0Klain
Comment options

@mbrandonw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants