Files: 58ab0241031aa549a35cce1e678c27065ae66221 / 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