https://github.com/aweiu/synchronize-promise
用于同步执行promise方法
https://github.com/aweiu/synchronize-promise
Last synced: 3 months ago
JSON representation
用于同步执行promise方法
- Host: GitHub
- URL: https://github.com/aweiu/synchronize-promise
- Owner: aweiu
- Created: 2016-10-25T08:17:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T06:50:37.000Z (over 3 years ago)
- Last Synced: 2025-02-15T19:08:30.582Z (3 months ago)
- Language: TypeScript
- Size: 106 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## synchronizePromise
A ts-type friendly promise Library —— Synchronize your promise!
### Install
```
npm install synchronize-promise
```### Demo
```javascript
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!](https://github.com/aweiu/concurrent-promise)