Move abort propagation logic to separate module

master
Sven Slootweg 6 years ago
parent a639c86135
commit 487023b2c0

@ -3,6 +3,7 @@
const Promise = require("bluebird");
const ms = require("ms");
const promiseDelaySince = require("@joepie91/promise-delay-every");
const propagateAbort = require("@ppstreams/propagate-abort");
module.exports = function rateLimitedStream(interval) {
let intervalInMilliseconds = (typeof interval === "number")
@ -20,8 +21,6 @@ module.exports = function rateLimitedStream(interval) {
return source.read();
});
},
abort: (source, reason) => {
source.abort(reason);
}
abort: propagateAbort
}
};

@ -7,6 +7,7 @@
"license": "WTFPL OR CC0-1.0",
"dependencies": {
"@joepie91/promise-delay-every": "^1.0.0",
"@ppstreams/propagate-abort": "^0.1.2",
"bluebird": "^3.5.4",
"ms": "^2.1.1"
}

Loading…
Cancel
Save