Skip to content

srcagency/psp-collect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull stream collect

A modern version of the pull-stream collect sink which returns a promise rather than calling a callback.

collect()
const {pull, values, map} = require('pull-stream')
const collect = require('psp-collect')

pull(values([1, 2, 3]), map(x => x * 2), collect()).then(console.log)
// [ 2, 4, 6 ]

Abort

Aborting without an error will end the stream and return the value so far.

abort([err])
const {pull, values} = require('pull-stream')
const collect = require('psp-collect')

const sink = collect()
sink.abort()
pull(values([1, 2, 3]), sink).then(console.log)
// []

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published