Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hacklone/arraync
Async Array methods polyfills
https://github.com/hacklone/arraync
array async async-await javascript promise typescript
Last synced: about 2 months ago
JSON representation
Async Array methods polyfills
- Host: GitHub
- URL: https://github.com/hacklone/arraync
- Owner: Hacklone
- License: mit
- Created: 2016-11-25T10:37:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-30T14:32:43.000Z (about 8 years ago)
- Last Synced: 2024-08-08T21:11:06.892Z (5 months ago)
- Topics: array, async, async-await, javascript, promise, typescript
- Language: TypeScript
- Size: 6.84 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arraync
Async Array methods polyfills
> Note: The methods introduced by this library are not part of any ECMAScript standard or proposal
## Install
> npm install --save arraync## Setup
```javascript
import 'arraync';
```## Features and Usage
- forEachAsync\(callback: Func\>, thisArg?: any): Promise\;
```javascript
await myArray.forEachAsync(async (item) => {
await doSomethingAsync(item);
});
```- everyAsync\(predicate: Func\>, thisArg?: any): Promise\;
```javascript
const isEvery = await myArray.everyAsync(async (item) => {
return await doSomethingAsync(item);
});
```- someAsync\(predicate: Func\>, thisArg?: any): Promise\;
```javascript
const isSome = await myArray.someAsync(async (item) => {
return await doSomethingAsync(item);
});
```- filterAsync\(predicate: Func\>, thisArg?: any): Promise\;
```javascript
const filteredArray = await myArray.filterAsync(async (item) => {
return await doSomethingAsync(item);
});
```- findAsync\(predicate: Func\>, thisArg?: any): Promise\;
```javascript
const foundItem = await myArray.findAsync(async (item) => {
return await doSomethingAsync(item);
});
```- findIndexAsync\(predicate: Func\>, thisArg?: any): Promise\;
```javascript
const foundIndex = await myArray.findIndexAsync(async (item) => {
return await doSomethingAsync(item);
});
```- mapAsync\(callback: Func\>, thisArg?: any): Promise\;
```javascript
const mappedArray = await myArray.mapAsync(async (item) => {
return await doSomethingAsync(item);
});