Closed kaminski closed 1 year ago
Hey @kaminski ,
You can access root state in Meta Reducers. Read more about Meta Reducers in the docs: https://mini-rx.io/docs/redux-setup#meta-reducers
If it is just about reading root state you can also use store.select
: https://mini-rx.io/docs/selectors
Probably you should use memoized selectors in that case.
I hope that helps!
Thanks! @spierala
I had something different in mind, but of course you are right, I could decorate the action object in the meta-reducer with whatever part of the root state is needed for lookups.
Is there any way to access the root state in a reducer? This would be to read data, not to manipulate the state beyond the reducer's scope.
In our use case, we need to look up values in a map, stored in a different branch of the root-state.