Home > @infiniteobjects/core-library-web > Async > pipe
Compose promise-returning & async functions into a reusable pipeline
Signature:
static pipe: typeof pPipe;
const addUnicorn = async string => `${string} Unicorn`;
const addRainbow = async string => `${string} Rainbow`;
const pipeline = Async.pipe(addUnicorn, addRainbow);
(async () => {
console.log(await pipeline('❤️'));
//=> '❤️ Unicorn Rainbow'
})();