git ssb

1+

Daan Patchwork / patchwork



Tree: 703b5de55b4f80cf231d914b9257bc81cd59ceef

Files: 703b5de55b4f80cf231d914b9257bc81cd59ceef / lib / pull-push-abort.js

369 bytesRaw
1const PullPushable = require('pull-pushable')
2const Abortable = require('pull-abortable')
3
4module.exports = function PullPushAbort () {
5 let aborter = Abortable()
6 const stream = PullPushable(() => {
7 if (aborter) {
8 aborter.abort()
9 aborter = null
10 }
11 stream.ended = true
12 })
13
14 stream.aborter = aborter
15 stream.ended = false
16
17 return stream
18}
19

Built with git-ssb-web