From 7fe47b78ca0589d8766298fb5d2bb40b3768e980 Mon Sep 17 00:00:00 2001 From: casperlamboo Date: Wed, 8 Nov 2017 23:27:40 +0100 Subject: [PATCH] fix last commit --- src/utils/async.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/async.js b/src/utils/async.js index 416b273..bb107f3 100644 --- a/src/utils/async.js +++ b/src/utils/async.js @@ -52,14 +52,14 @@ export function createThrottle() { if (!startLoop) return; - (function loop() { + return (function loop() { return next().then(() => { if (typeof next === 'function') return loop(); }); next = true; - })(); - - next = null; + })().then(() => { + next = null; + }); }; }