mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-04-26 06:27:58 +00:00
chore: update to version 14.0.11 and align website URLs
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.nextTick = nextTick;
|
||||
/**
|
||||
* @name nextTick
|
||||
* @description Defer the operation to the queue for evaluation on the next tick
|
||||
*/
|
||||
function nextTick(onExec, onError) {
|
||||
// While Promise.resolve().then(...) would defer to the nextTick, this
|
||||
// actually does not play as nicely in browsers like the setTimeout(...)
|
||||
// approach. So the safer, though less optimal approach is the one taken here
|
||||
setTimeout(() => {
|
||||
Promise
|
||||
.resolve()
|
||||
.then(() => {
|
||||
onExec();
|
||||
})
|
||||
.catch((error) => {
|
||||
if (onError) {
|
||||
onError(error);
|
||||
}
|
||||
else {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user