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
Is your feature request related to a problem? Please describe.
When reading the window.Fusion property I should/must ensure the properties im trying to access exists
e.g
if (!window?.Fusion) {
throw new Error('No fusion framework found, required for fusion bookmarks module to work');
}
const fusion = window.Fusion;
if (!fusion.modules.serviceDiscovery) {
throw new Error('Service discovery module not configured, required for fusion bookmarks module to work');
}
const client = await fusion.modules.serviceDiscovery.createClient('bookmarks');
return client;
Describe the solution you'd like
Proposed solution: Function on window object called something like window.getFusionInstance(). Which implementes the above checks. Could possibly return an object with further functions that ensures the module you're dotting into also exists. Either by using Proxy class or by getting modules using functions
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
const fusion = window.getFusion();
//Could throw error saying service discovery is not configured/included
fusion.getModule("service_discovery");
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
When reading the window.Fusion property I should/must ensure the properties im trying to access exists
e.g
Describe the solution you'd like
Proposed solution: Function on window object called something like window.getFusionInstance(). Which implementes the above checks. Could possibly return an object with further functions that ensures the module you're dotting into also exists. Either by using Proxy class or by getting modules using functions
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
const fusion = window.getFusion();
//Could throw error saying service discovery is not configured/included
fusion.getModule("service_discovery");
The text was updated successfully, but these errors were encountered: