From c27dfe1d0994c65de601760d082cf4668dc3fad0 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 28 Jul 2020 12:29:43 -0400 Subject: [PATCH] fix(runtime-core): scheduler should allow intentional self triggering effects fix #1727 --- packages/runtime-core/src/scheduler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime-core/src/scheduler.ts b/packages/runtime-core/src/scheduler.ts index 33743dce6..b54f5469c 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -26,7 +26,7 @@ export function nextTick(fn?: () => void): Promise { } export function queueJob(job: Job) { - if (!queue.includes(job, flushIndex)) { + if (!queue.includes(job, flushIndex + 1)) { queue.push(job) queueFlush() } @@ -43,7 +43,7 @@ export function queuePostFlushCb(cb: Function | Function[]) { if (!isArray(cb)) { if ( !pendingPostFlushCbs || - !pendingPostFlushCbs.includes(cb, pendingPostFlushIndex) + !pendingPostFlushCbs.includes(cb, pendingPostFlushIndex + 1) ) { postFlushCbs.push(cb) }