SliceGroup
A SliceGroup
allows grouping several Slices under a given name.
A SliceGroup
is similar in concept to a Folder, where the Slices are the files.
Instead of having all the Slices created directly under the root, one can group
Slices by some arbitrary chosen group names.
This can make it easier to navigate in the Redux Dev Tools, a large redux state object with 30+ Slices. SliceGroups like folders can be nested. Avoid deep nesting since it may have the opposite effect, making it difficult to find the slices in the store state object.
A SliceGroup
is an object that looks like:
{ addReducers: AddReducers, path: string, reducer: Reducer,}
#
PropertiesaddReducers
#
A function that children Slices or SliceGroups use to add their reducer to this SliceGroup's reducer.
path
#
A string expressing the location of this SliceGroup
.
reducer
#
The SliceGroup
's reducer.
It is a combine reducer that is mutable.
Use the SliceGroup
's addReducers function to add reducers to it.
#
NoteA SliceGroup
is a SliceParent
that exposes its reducer.