transform-spread-iterable

1.4.1 • Public • Published

transform-spread-iterable

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:

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}

Travis Build Status Code Climate Coverage Status

NPM downloads

API

const spread = (iterable: Iterable): Iterable

Given a source iterable, return an iterable with all source item that are iterable spreaded.

Install

With npm installed, run

$ npm install transform-spread-iterable

See Also

License

MIT

Dependencies (1)

Dev Dependencies (7)

Package Sidebar

Install

npm i transform-spread-iterable

Weekly Downloads

2,982

Version

1.4.1

License

MIT

Last publish

Collaborators

  • parroit