Skip to content

srcagency/psp-drain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pull stream drain

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

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

pull(values([1, 2, 3]), drain(console.log)).then(() => console.log('Done'))
drain([op])

Abort

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

const sink = drain()
sink.abort()
pull(values([1, 2, 3]), sink).then(() => console.log('Done'))

const sink = drain()
sink.abort(new Error())
pull(values([1, 2, 3]), sink).catch(console.error)
abort([err])

About

A pull-stream drain which returns a promise

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published