Skip to content

Callbag operator that flattens iterables

License

Notifications You must be signed in to change notification settings

aaronshaf/callbag-flatten-iter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Callbag operator that flattens iterables

Resources

License

Stars

Watchers

Forks

Packages

No packages published