@jswork/next-promise-compose
v1.0.7
Published
Promise compose for next.
Downloads
8
Maintainers
Readme
next-promise-compose
Promise compose for next.
installation
npm install -S @jswork/next-promise-compose
usage
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.