From 4ef5c8d42408fd444114604292106c0027600fa4 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 28 Jul 2020 13:23:09 -0400 Subject: [PATCH] fix(runtime-core): fix scheduler dedupe when not flushing --- 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 b54f5469ce2..07ee84a3982 100644 --- a/packages/runtime-core/src/scheduler.ts +++ b/packages/runtime-core/src/scheduler.ts @@ -13,7 +13,7 @@ let currentFlushPromise: Promise | null = null let isFlushing = false let isFlushPending = false -let flushIndex = 0 +let flushIndex = -1 let pendingPostFlushCbs: Function[] | null = null let pendingPostFlushIndex = 0 @@ -114,7 +114,7 @@ function flushJobs(seen?: CountMap) { callWithErrorHandling(job, null, ErrorCodes.SCHEDULER) } } - flushIndex = 0 + flushIndex = -1 queue.length = 0 flushPostFlushCbs(seen)