git ssb

1+

Daan Patchwork / patchwork



Tree: 55fc93a9190c25f467ead205ab8d676b5191dbd4

Files: 55fc93a9190c25f467ead205ab8d676b5191dbd4 / 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