# callbag-from-iter

> Convert an iterable or iterator to a callbag pullable source

Latest version **1.3.0** (published 2020-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-from-iter
pnpm add callbag-from-iter
yarn add callbag-from-iter
bun add callbag-from-iter
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2020-10-14 |
| First published | 2018-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | staltz.com |
| Maintainers | zimme, staltz |
| Keywords | callbag |

## Links

- npm: https://www.npmjs.com/package/callbag-from-iter
- Repository: https://github.com/staltz/callbag-from-iter
- Homepage: https://github.com/staltz/callbag-from-iter#readme
- Issues: https://github.com/staltz/callbag-from-iter/issues
- npm.io page: https://npm.io/package/callbag-from-iter

## Dependencies (1)

- [callbag](https://npm.io/package/callbag.md) ^1.2.0

## Recent versions

- 1.3.0 (latest) — 2020-10-14
- 1.2.0 — 2018-06-02
- 1.1.0 — 2018-05-01
- 1.0.0 — 2018-01-30

## README

# callbag-from-iter

Convert a JS Iterable or Iterator to a callbag pullable source (it only sends data when requested).

`npm install callbag-from-iter`

## example

Convert an Iterable:

```js
const fromIter = require('callbag-from-iter');
const iterate = require('callbag-iterate');

const source = fromIter([10, 20, 30, 40]);

iterate(x => console.log(x))(source);   // 10
                                        // 20
                                        // 30
                                        // 40
```

Convert an Iterator:

```js
const fromIter = require('callbag-from-iter');
const iterate = require('callbag-iterate');

const source = fromIter([10, 20, 30, 40].entries());

iterate(x => console.log(x))(source); // [0,10]
                                      // [1,20]
                                      // [2,30]
                                      // [3,40]
```

---
_Source: https://npm.io/package/callbag-from-iter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
