I'm fairly new to Redux/RTK so I'm still figuring things out.
The situation:
I have a locationsSlice which stores an array of ids (favIds
) in the state.
I also have a forecastSlice which has an array of objects (forecastObjects
).
My question:
I want to write a global selector that can return filtered forecast objects based on the ids in the locationsSlice. To do that, I need to reference another slice's state. What is the best way to do this?
I could write a hook for such logic, but is there a way to do this inside a slice? Is that bad practice?