An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.
One or more functions to compose left-to-right. Each may return a plain value or a Promise.
An async function that passes its argument through every function in order, awaiting each step.
// All sync functions — result is still a Promise
const add1 = (n: number) => n + 1;
const double = (n: number) => n * 2;
const pipeline = asyncPipe(add1, double);
await pipeline(3); // (3 + 1) * 2 = 8
Composes functions from left to right, threading the resolved return value of each function as the argument to the next. Each function may be sync or async — the result is always a Promise.
For sync-only composition, see pipe.