We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buffer(size, stream) creates new stream where all source items grouped into sub groups
buffer(size, stream)
buffer(2, [1,2,3,4,5,6]) => [[1,2], [3,4], [5,6]] buffer(3, [1,2,3,4,5,6]) => [[1,2,3], [4,5,6]]
bufferBy(predicate, stream) similar to previous one, but groups by predicate result
bufferBy(predicate, stream)
bufferBy(i => i%2===1, [1,2,3,4,5,6]) => [[1],[2],[3],[4],[5],[6]] bufferBy(i < 3, [1,2,3,4,5,6]) => [[1,2],[3,4,5,6]] bufferBy(i%3>0, [1,2,3,4,5,6]) => [[1,2],[3],[4,5],[6]]
pluck(field, stream) extracts field value from each item
pluck(field, stream)
pluck('a') // equivalent to map(({ a }) => a)
scan(accFn, stream) accumulates value of each item to produce new stream (like history of reduce() operation)
scan(accFn, stream)
reduce()
const add = (a,b) => a + b; scan(add, [1,2,3,4,5,6]) => [1,3,6,10,15,21]
flatten(stream) flattens initial stream
flatten(stream)
flatten([[1,2,3],[4,5,6]]) => [1,2,3,4,5,6];
The text was updated successfully, but these errors were encountered:
No branches or pull requests
buffer(size, stream)
creates new stream where all source items grouped into sub groupsbufferBy(predicate, stream)
similar to previous one, but groups by predicate resultpluck(field, stream)
extracts field value from each itemscan(accFn, stream)
accumulates value of each item to produce new stream (like history ofreduce()
operation)flatten(stream)
flattens initial streamThe text was updated successfully, but these errors were encountered: