let inLoading = false, promise = null;
function getData() {
if (!inLoading) {
inLoading = true
promise = new Promise((resolve, reject) => {
setTimeout(() => {
resolve({a:Date.now()});
}, 1000);
});
}
return promise;
};
module.exports = {
execute: async () => {
let data1 = await getData();
let data2 = await getData();
console.log(data1);
console.log(data2);
}
}