1.4.1 • Published 9 years ago
transform-spread-iterable v1.4.1
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}API
const spread = (iterable: Iterable): IterableGiven a source iterable, return an iterable with all source item that are iterable spreaded.
Install
With npm installed, run
$ npm install transform-spread-iterableSee Also
License
MIT