An open API service indexing awesome lists of open source software.

https://github.com/rocky-jaiswal/async-utils

Async function utils
https://github.com/rocky-jaiswal/async-utils

Last synced: 8 months ago
JSON representation

Async function utils

Awesome Lists containing this project

README

          

# Async-Utils

Compose async functions with ease

```
const arr: number[] = []

const f1 = async (a: number[]) => {
await delay(300)
a.push(1)
return a
}

const f2 = async (a: number[]) => {
await delay(200)
a.push(2)
return a
}

const f3 = async (a: number[]) => {
await delay(100)
a.push(3)
return a
}

const res = await pipeAsync(f1, f2, f3)(arr)
console.log(res) // [1, 2, 3]
```