summaryrefslogtreecommitdiff
path: root/lib/doDuring.js
diff options
context:
space:
mode:
authorAlex Early <alexander.early@gmail.com>2018-07-01 17:12:06 -0700
committerGitHub <noreply@github.com>2018-07-01 17:12:06 -0700
commit53f613039af68353371c2953446fa8084b3fc86b (patch)
treebd6d4e25cc30c6321c7b0810d86e1049b43764eb /lib/doDuring.js
parent2a135a422f5da6ab6c8d242b2428828bb51eb1f8 (diff)
downloadasync-53f613039af68353371c2953446fa8084b3fc86b.tar.gz
feat: Canceling flows (#1542)
* cancelable foreach * cancelable waterfall * cancellable auto * fix lint * fix tests * cancelable whilst/until/during/forever * fix waterfall test. It WILL get there * docs * auto should not start other tasks once canceled * simplify waterfall, add test for arrays * simplify eachOf * cancelable retry * cancelable eachOf for arrays * revert test tweak
Diffstat (limited to 'lib/doDuring.js')
-rw-r--r--lib/doDuring.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/doDuring.js b/lib/doDuring.js
index ac2a04c..5eb2b92 100644
--- a/lib/doDuring.js
+++ b/lib/doDuring.js
@@ -30,6 +30,7 @@ export default function doDuring(fn, test, callback) {
function next(err/*, ...args*/) {
if (err) return callback(err);
+ if (err === false) return;
var args = slice(arguments, 1);
args.push(check);
_test.apply(this, args);
@@ -37,6 +38,7 @@ export default function doDuring(fn, test, callback) {
function check(err, truth) {
if (err) return callback(err);
+ if (err === false) return;
if (!truth) return callback(null);
_fn(next);
}