This commit is contained in:
Mateusz Gruszczyński committed 2026-10-29 13:07:22 +01:00
1 parent b15a6c54ce
commit d36a4b2451
22 files changed
+926 -114

No files matched your search

+7 -2
View File
@@ -19,8 +19,13 @@ function localAsset(path) {
}
function once(key, factory) {
if (!promiseCache.has(key)) promiseCache.set(key, Promise.resolve().then(factory));
return promiseCache.get(key);
if (promiseCache.has(key)) return promiseCache.get(key);
const promise = Promise.resolve().then(factory);
promiseCache.set(key, promise);
promise.catch(() => {
if (promiseCache.get(key) === promise) promiseCache.delete(key);
});
return promise;
}
function loadClassicScript(path, globalName) {