afeiship / next-promise-compose

Promise compose for next.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

next-promise-compose

Promise compose for next.

version license size download

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.

About

Promise compose for next.

License:MIT License


Languages

Language:JavaScript 100.0%