AsyncArray
Run array higher order functions asynchronously
Installation
npm install --save @sebowy/async-array
# or
yarn add @sebowy/async-array
Usage
Examples
- async sorting
import { AsyncArray } from "@sebowy/async-array";
const array = [3, 5, 1, 2, 4];
const asyncArray = new AsyncArray(array);
asyncArray
.sort((left, right) => Promise.resolve(left - right))
.then(console.log);
will produce:
[1, 2, 3, 4, 5]