synchronize-promise
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

synchronizePromise

A ts-type friendly promise Library —— Synchronize your promise!

Install

npm install synchronize-promise

Demo

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));

Related

A ts-type friendly promise Library —— Concurrent your promise!

Package Sidebar

Install

npm i synchronize-promise

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

2.74 kB

Total Files

7

Last publish

Collaborators

  • aweiu