redux-dynamic-modules icon indicating copy to clipboard operation
redux-dynamic-modules copied to clipboard

Place in the store where dynamic module should be added

Open Stwosch opened this issue 4 years ago • 1 comments

Hello,

I'm struggling with adding dynamic modules to the store in a certain place.

In my case, I'm adding modules where each module has specific GUID that is its id. Here is the structure of my dynamic module. const modules = [{ id, reducerMap: { [id]: combineReducers(reducers) } }] In this case everything works fine, modules are attached to the store.

But I wouldn't like to place every dynamic loaded module in the root of the store. I would like to place them in the specific place in the store e.g. 'dynamicModules' key in the store. So I tried to do that in this way: const modules = [{ id, reducerMap: { dynamicModules: combineReducers({ [id]: reducer }) } }]

But it isn't working, because library checks whether the same key already exists in the store, so it will add only the first dynamic module. So my question is - Is there a method where I can point in which place dynamic modules should be attached in the store?

Stwosch avatar May 25 '20 15:05 Stwosch

I have the same requirement, @Stwosch did u find any solution for this ?

sanchitbansal10 avatar Oct 23 '20 07:10 sanchitbansal10