Fast, composable and feature rich iterable processing in javascript/typescript.
max-normalized ops/s of a filter → map → reduce computation for input arrays of different sizes for different libraries and a for loop based. (longer bar is better)Flow-it lends itself to using flow
(left to right composition) and pipe
.
import {map, filter} from 'flow-it/operators'
import {flow} from 'flow-it/functions'
const incrementedEvens = flow(map(increment), filter(even))
import {pipe} from 'flow-it/functions'
import {map, filter} from 'flow-it/operators'
import {reduce} from "flow-it/collectors";
const sum = reduce(add, () => 0)
pipe(from(someArrayOfNumbers),
map(increment),
filter(even),
sum) === pipe(from(someArrayOfNumbers), incrementedEvens, sum)
from
, fromEntries
, fromIterable
, fromArray
map
, filter
, flatMap
(mapCat
), cat
(flatten
), partition
, scan
, take
, drop
groupBy
, joining
, last
, reduce
, toArray
, toMap
, toRecord
, toSet