Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-promise-compose
Promise compose for next.
https://github.com/afeiship/next-promise-compose
async compose next one-by-one promise sync
Last synced: 24 days ago
JSON representation
Promise compose for next.
- Host: GitHub
- URL: https://github.com/afeiship/next-promise-compose
- Owner: afeiship
- License: mit
- Created: 2021-04-19T12:30:30.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-05-24T04:43:12.000Z (over 1 year ago)
- Last Synced: 2024-10-28T05:00:06.041Z (2 months ago)
- Topics: async, compose, next, one-by-one, promise, sync
- Language: JavaScript
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-promise-compose
> Promise compose for next.[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]## installation
```bash
npm install -S @jswork/next-promise-compose
```## usage
```js
import '@jswork/next-promise-compose';const double = x => x * 2;
const square = x => x * x;
const plus3 = x => new Promise(resolve => setTimeout(() => resolve(x + 3), 100));nx.promiseCompose(plus3, square, double)(2)
.then(result => {
console.log(result); // 50
})
.catch(console.error);
```## license
Code released under [the MIT license](https://github.com/afeiship/next-promise-compose/blob/master/LICENSE.txt).[version-image]: https://img.shields.io/npm/v/@jswork/next-promise-compose
[version-url]: https://npmjs.org/package/@jswork/next-promise-compose[license-image]: https://img.shields.io/npm/l/@jswork/next-promise-compose
[license-url]: https://github.com/afeiship/next-promise-compose/blob/master/LICENSE.txt[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-promise-compose
[size-url]: https://github.com/afeiship/next-promise-compose/blob/master/dist/next-promise-compose.min.js[download-image]: https://img.shields.io/npm/dm/@jswork/next-promise-compose
[download-url]: https://www.npmjs.com/package/@jswork/next-promise-compose