1.1.0 • Published 3 years ago

@sebowy/async-array v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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]