You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem I am working on is making apps work under micro frontend architecture. One challenge I am working on is I like to completely reject a reducer from the Redux store when users leave the page aka componentWillUnmount
I've done the PoC as following below
// injectReducer.jsconstuseInjectReducer=({ key, reducer })=>{conststore=useStore();const[isInjected,setIsInjected]=React.useState(false);React.useLayoutEffect(()=>{getInjectors(store).injectReducer(key,reducer);setIsInjected(true);return()=>{// To remove a reducer from Redux storegetInjectors(store).rejectReducer(key);};},[]);returnisInjected;};
Hi
The problem I am working on is making apps work under micro frontend architecture. One challenge I am working on is I like to completely reject a reducer from the Redux store when users leave the page aka
componentWillUnmount
I've done the PoC as following below
Do you think, does this worth a pull request?
The text was updated successfully, but these errors were encountered: