https://github.com/parro-it/transform-spread-iterable
An iterable transform that spread each iterable received and emit its items
https://github.com/parro-it/transform-spread-iterable
Last synced: 11 months ago
JSON representation
An iterable transform that spread each iterable received and emit its items
- Host: GitHub
- URL: https://github.com/parro-it/transform-spread-iterable
- Owner: parro-it
- License: mit
- Created: 2016-10-07T10:07:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-06-03T09:21:18.000Z (over 5 years ago)
- Last Synced: 2024-09-15T01:56:15.893Z (over 1 year ago)
- Language: JavaScript
- Size: 150 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# transform-spread-iterable
[](https://greenkeeper.io/)
> An iterable transform that spread each iterable received and emit its items
background details relevant to understanding what this module does
## Usage
Let's spread the `arr` array, each item of `arr` will became an item of resulting iterable:
```js
const spread = require('transform-spread-iterable');
const arr = [1, 2, 3];
for (const item of spread([arr, 42, 43])) {
console.log({item});
}
```
This will output
```
{item :1}
{item :2}
{item :3}
{item :42}
{item :43}
```
[](http://travis-ci.org/parro-it/transform-spread-iterable)
[](https://codeclimate.com/github/parro-it/transform-spread-iterable)
[](https://coveralls.io/github/parro-it/transform-spread-iterable?branch=master)
[](https://npmjs.org/package/transform-spread-iterable)
## API
```js
const spread = (iterable: Iterable): Iterable
```
Given a source iterable, return an iterable with all source item that are iterable spreaded.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install transform-spread-iterable
```
## See Also
- [`noffle/common-readme`](https://github.com/noffle/common-readme)
## License
MIT