14 lines
364 B
JavaScript
14 lines
364 B
JavaScript
// queueMicrotask() ponyfill
|
|
// https://github.com/libsql/libsql-client-ts/issues/47
|
|
let _queueMicrotask;
|
|
if (typeof queueMicrotask !== "undefined") {
|
|
_queueMicrotask = queueMicrotask;
|
|
}
|
|
else {
|
|
const resolved = Promise.resolve();
|
|
_queueMicrotask = (callback) => {
|
|
resolved.then(callback);
|
|
};
|
|
}
|
|
export { _queueMicrotask as queueMicrotask };
|