# immutable-list-reduce-async

> Extention for immutable list to perform an async reducer

Latest version **0.0.1** (published 2017-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install immutable-list-reduce-async
pnpm add immutable-list-reduce-async
yarn add immutable-list-reduce-async
bun add immutable-list-reduce-async
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2017-05-05 |
| First published | 2017-05-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ilya Fadeev |
| Maintainers | ilyavf |

## Links

- npm: https://www.npmjs.com/package/immutable-list-reduce-async
- Repository: https://github.com/ilyavf/immutable-list-reduce-async
- Homepage: https://github.com/ilyavf/immutable-list-reduce-async#readme
- Issues: https://github.com/ilyavf/immutable-list-reduce-async/issues
- npm.io page: https://npm.io/package/immutable-list-reduce-async

## Dependencies (2)

- [data.task](https://npm.io/package/data.task.md) ^3.1.1
- [immutable](https://npm.io/package/immutable.md) ^3.8.1

## Recent versions

- 0.0.1 (latest) — 2017-05-05

## README

# immutable-list-reduce-async
Small extention to the immutable list to perform an async reducer

This can be useful if a reducer function has to perform an asynchronous operation. So, instead of a result it returns
an instance of a Task (from `data.task` package):

```js
// myReducer :: b -> a -> Task b
const myReducer = (acc, el) =>
  new Task((reject, resolve) => {
    // Some async action here.
    setTimeout(function () {
      resolve(acc + el)
    }, 0)
  })

// reduceAsync :: (b -> a -> Task b) -> b -> Task b
List.prototype.reduceAsync
```

## Example:
```js
const Task = require('data.task')
const { List } = require('./index')

// Reduce to the sum of list elements with an async action (Task):
var app = List([1, 2, 3]).reduceAsync((acc, x) => Task.of(acc + x), 0)

app.fork(err => console.log(err),
         res => console.log(res))

// >>> 6
```

---
_Source: https://npm.io/package/immutable-list-reduce-async · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
