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
I have a use case where I want to shared Singleton instance across Microfrontend with following condition:
First Micro frontend created in Vanilla JS
Other Micro frontend created in React JS
which ever load first initializes the instance of my JS script and other while loading just uses it.
I was looking forward to use UMD but couldn't work it out without attaching initialised instance to window object. But I don't want to expose it at global variable level.
The text was updated successfully, but these errors were encountered:
As per my under standing of your query ill assume the following things
1.You created a module based on UMD namely myMicroFrontend that is used by another vannila js script
2.You created a component on React JS that requires your myMicroFrontend
you need a hack to achieve the singleton instance across the code without a global declaration
you can try custom events to load your micro frontend 😁 but without global variable how you store if your microfrontend has loaded ? how you know it its not loaded because javascript is not syncronous by default
Hi,
I have a use case where I want to shared Singleton instance across Microfrontend with following condition:
I was looking forward to use UMD but couldn't work it out without attaching initialised instance to window object. But I don't want to expose it at global variable level.
The text was updated successfully, but these errors were encountered: