Files: 1b789e63aa59f5d3e5539a4432c8b3c466977a0e / lib / pull-push-abort.js
369 bytesRaw
1 | const PullPushable = require('pull-pushable') |
2 | const Abortable = require('pull-abortable') |
3 | |
4 | module.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