stack

Home > @infiniteobjects/core-library-web > Async > pipe

Async.pipe property

Compose promise-returning & async functions into a reusable pipeline

Signature:

static pipe: typeof pPipe;

Example


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'
 })();