I’m migrating our old Redux setup to use Redux Toolkit. We have a concept of entities
, which contains nested entities (sites, controllers, users, doors, areas, areaGroups…). This was all controlled by one fat entity reducer and an entity utility function which kind of does a similar thing to createEntityAdapter
, indexing entities by an ID. What I’m trying to do is create nested slices.
I want to break my entity slice down so that each entity has it’s own slice which is responsible for defining it’s own thunks/selectors and the like. I plan to normalize all my entities using the RTKs entity adapter method. With my new entities slice, it will have it’s own reducers which can act on dispatched actions from any of the child entities.
I have cloned the RTK sample and added an entities feature with related slices: https://stackblitz.com/~/github.com/rickysullivan-gallagher/vitejs-vite-ctk89t
I’m not sure what I’m doing wrong, but I feel like my reducers from each entity somehow need to get added to the entities slice. Actions dispatched aren’t being picked up by their respective reducers.