Replies: 2 comments 5 replies
-
Nextjs-mf we need redux-toolkit and RTK Query for MFE. Are any support for this? |
Beta Was this translation helpful? Give feedback.
3 replies
-
Problem to solve: Perhaps similar to the old “Redux Modules” package from Microsoft? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm currently using injectEndpoints in my app to lazy load parts of the app (code splitting), based on routes.
Now we are looking to take this one step further and share entire modules, including reducers and queries etc, across apps using module federation. The goal would be that each "module" that we federate would be able to inject its own reducers and queries into the store of the app they are loaded into.
Similar to the common approach suggested in the docs of exposing an injectReducer on the store you are injecting the module into, I was hoping to use the injectEndpoints approach to inject all of the endpoints of the module into the global RTK Query api object of the app you are loading the module into. Typing becomes a bit problematic though, as well as getting access to the auto-generated hooks.
Has anyone seen any examples of how to do this?
Beta Was this translation helpful? Give feedback.
All reactions