git ssb

1+

Daan Patchwork / patchwork



Tree: 401c797bb92a373ffa4499d47ecea37f75e2a16e

Files: 401c797bb92a373ffa4499d47ecea37f75e2a16e / 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