A ts-type friendly promise Library —— Synchronize your promise!
npm install synchronize-promise
import synchronizePromise from "synchronize-promise";
function test() {
return new Promise((resolve) =>
setTimeout(() => resolve("ConcurrentPromise"), 3000)
);
}
const sTest = synchronizePromise(test);
// you will see the 「ConcurrentPromise」 every three seconds
sTest().then((ret) => console.log(ret));
sTest().then((ret) => console.log(ret));
sTest().then((ret) => console.log(ret));
A ts-type friendly promise Library —— Concurrent your promise!