Skip to content

dak0rn/compose-await

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compose-await

compose for async functions

Composes async functions, awaiting each of them. Please keep in mind that functions are applied from right to left and only may take one argument.

Installation

yarn add compose-await

Usage

const compose = require('compose-await');

const first = async function(a) {
    // ...
};

const second = async function(b) {
    // ...
};

const third = async function(c) {
    // ...
};

const together = compose(third, second, first);
const result = await together(42);