Creates a curried function that takes an input value of type T and returns an async iterable based on the provided adapter function.
A function that takes an input value of type T and returns an AsyncIterable of U.
const arrayAdapter: Adapter<number[], number> = (array) => { let index = 0; return { next: () => Promise.resolve( index < array.length ? { value: array[index++], done: false } : { value: undefined, done: true } ), };};const iterable = withCustomAdapter(arrayAdapter)([1, 2, 3]);(async () => { for await (const value of iterable) { console.log(value); // Logs 1, 2, 3 }})();
The type of input value.
The type of data contained in the resulting async iterable.
The adapter function to transform the input value into an async iterable.
Generated using TypeDoc
Creates a curried function that takes an input value of type T and returns an async iterable based on the provided adapter function.
Returns
A function that takes an input value of type T and returns an AsyncIterable of U.
Example