-
Suppose I had a Single Feature that works perfectly with a single shared dependency. After a while, I decided to make more of that single feature as children of a parent. So now I have something like:
So how can I access the state of each child during the Is this a good idea in the first place? How about passing the first two arguments into the ReducerBuilder as the original ForEach does in the SwiftUI? I really appreciate any help you can provide. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Not part of TCA yet, but this would be the prime use case for reducer readers: #1969 In the meantime, you could implement it by manually handling the child reducer wrapping the same way (i.e. by manually calling |
Beta Was this translation helpful? Give feedback.
-
Turns out this old drafted PR is exactly what I need. Closing this discussion in favor of that. |
Beta Was this translation helpful? Give feedback.
Not part of TCA yet, but this would be the prime use case for reducer readers: #1969
In the meantime, you could implement it by manually handling the child reducer wrapping the same way (i.e. by manually calling
reduce(into:action:)
on the child reducer from the parent in a dependency injection context).