Promise compose for next.
npm install -S @jswork/next-promise-compose
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);
Code released under the MIT license.