We have a big project that started with he first version of TCA and currently we're working with version 0.57.0
We're planning to migrate to the latest version of TCA but that will take some time to happen and we need to use NavigationStackStore but since all of our reducers are of type AnyReducer I can't find a way to implement it.
Found a way to use Reducer Protocol inside AnyReducer but couldn't find a way
to use AnyReducer in side Reducer Protocol
or mix them
Cannot convert value of type '_StackReducer<Reduce<CounterDomain.State, CounterDomain.Action>, CounterDomain.Path>'
to expected argument type '[AnyReducer<CounterDomain.State, CounterDomain.Action, Void>]'
The sample code above does not contain any Environment but in the case it does noticed that now I have to initialize the environment 2 times in different places:
1st time in the parents pullback
2nd time inside the child reducer inside the Reduce init
is there any way to avoid creating the same environment 2 times?
When the environment contains a lot of properties creating 2 instances is a big issue
Creating an environment value shouldn't be a big deal, and is ideally just temporary as you migrate away from AnyReducer you will be able to eliminate the environment entirely.