Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place in the store where dynamic module should be added #143

Open
Stwosch opened this issue May 25, 2020 · 1 comment
Open

Place in the store where dynamic module should be added #143

Stwosch opened this issue May 25, 2020 · 1 comment

Comments

@Stwosch
Copy link

Stwosch commented May 25, 2020

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?

@sanchitbansal10
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants