@wangcch/async-array
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Async-Array

array asynchronous loop

Build Status

usage

# install dependencies
yarn

# build for production with minification
yarn build

# test
yarn test

example

import {
  filterAsync,
  mapAsync,
  forEachAsync,
  someAsync,
  everyAsync,
} from "@wangcch/async-array";
// filterAsync
const result = await filterAsync([1, 2, 3], async i => i > 2);
// [3]
// mapAsync
const result = await mapAsync([1, 2, 3], async i => i * 2);
// [2, 4, 6]
// forEachAsync
let arr: number[] = [];
await forEachAsync([1, 2, 3], async i => {
  arr.push(i * 2);
});

return arr;
// [2, 4, 6]
// someAsync
const result = await someAsync([1, 2, 3], async i => i > 2);
// true
// everyAsync
const result = await everyAsync([1, 2, 3], async i => i > 2);
// false

workflow

https://github.com/wangcch/ts-npm-workflow

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i @wangcch/async-array

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

21.6 kB

Total Files

15

Last publish

Collaborators

  • wangcch