Skip to content

Instantly share code, notes, and snippets.

@callstack-bot
Created September 21, 2022 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callstack-bot/1267869dff1de6fdb57507d4f52e815d to your computer and use it in GitHub Desktop.
Save callstack-bot/1267869dff1de6fdb57507d4f52e815d to your computer and use it in GitHub Desktop.
ScriptManager.shared.addResolver(async (scriptId, caller) => {
let url;
const containers = await fetchURLs();
const resolveURL = Federated.createURLResolver({
containers,
});
if (caller === 'main') {
url = Script.getDevServerURL(scriptId);
} else {
url = resolveURL(scriptId, caller);
}
if (!url) {
return undefined;
}
return {
url,
cache: false,
query: {
platform: Platform.OS,
},
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment