Skip to content
Discussion options

You must be logged in to vote

Passing stores in dependencies is not something both types were designed for, and I'm almost certain that it will subtlety break things somewhere, and I wouldn't advice to do so. Furthermore, Dependency is not built to work in View, and this is another source of issues that are hard to debug. The "proper" property wrapper to use in View for a similar function would be @Environment. If you insist in going the "store from environment/dependencies" route, you can create an EnvironmentKey to pass your root store in SwiftUI's Environment. You can then pop this store out from the parent view, and scope it to pass a fully fledged store to your View's init like it is commonly done. This should li…

Replies: 1 comment 4 replies

Comment options

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

@tunchamroeun
Comment options

@tgrapperon
Comment options

@tunchamroeun
Comment options

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