Created
September 21, 2022 14:56
-
-
Save callstack-bot/1267869dff1de6fdb57507d4f52e815d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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