Closed dkreft closed 4 years ago
Okay, I think I understand this now.
The store partitions that I've highlighted in red in the screenshot, above, are due to this:
// The following four should be nested within
getCustomerModule(),
getEnrollmentRecordsModule(),
getOrdersModule(),
getPaymentObligationsModule(),
While the (properly) nested parts are due to this in my reducer:
/* File: ./reducer.js */
export default combineReducers({
detailsPage: detailsPageReducer,
customer: customerReducer,
enrollmentRecords: enrollmentRecordsReducer,
orders: customerOrdersReducer,
paymentObligations: paymentObligationsReducer,
})
So it looks like what I need to do for my purposes is just remove the getFooModule()
parts from the config, and roll-up all my subordinate sagas in my ./sagas.js
and reduce my configuration down to this:
export function getModule() {
return [
getAssignableUsersModule(),
getBillingAccountModule(),
{
id: ID,
reducerMap: {
[ID]: reducer,
},
sagas: [
customerDetailsPageSagas,
],
},
]
}
Does that sound about right?
I have a module that depends upon several other modules that are scoped to the primary module, but when I load the page, I'm seeing the dependant modules as both peers of my primary module and as children of it.
Primary module
As an example of a child module:
Now, when I load the page, my store looks like this:
I think I know why the store parts in red are where they are (because I didn't follow https://redux-dynamic-modules.js.org/#/reference/Dependencies), but what's not clear to me is why my dependent store partitions are in both places.