v0.2.96
This commit is contained in:
1 parent
b15a6c54ce
commit
d36a4b2451
22 files changed
+926
-114
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user