callbag-flatten-iter

Callbag operator that flattens iterables

Usage no npm install needed!

<script type="module">
  import callbagFlattenIter from 'https://cdn.skypack.dev/callbag-flatten-iter';
</script>

README

yarn add callbag-flatten-iter
const pipe = require("callbag-pipe");
const fromIter = require("callbag-from-iter");
const flattenIter = require("callbag-flatten-iter");
const forEach = require("callbag-for-each");

pipe(
  fromIter([[10], [20], [30], [40, 50, 60]]),
  flattenIter,
  forEach(i => {
    // called 6 times
  })
);

If you're blessed with the pipeline operator:

fromIter([[10], [20], [30], [40, 50, 60]])
  |> flattenIter
  |> forEach(i => {
    // called 6 times
  });

Learn more