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; + }); }; }