Skip to content

Commit

Permalink
fix(runtime-core): scheduler should allow intentional self triggering…
Browse files Browse the repository at this point in the history
… effects

fix #1727
  • Loading branch information
yyx990803 committed Jul 28, 2020
1 parent 730e39e commit c27dfe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function nextTick(fn?: () => void): Promise<void> {
}

export function queueJob(job: Job) {
if (!queue.includes(job, flushIndex)) {
if (!queue.includes(job, flushIndex + 1)) {
queue.push(job)
queueFlush()
}
Expand All @@ -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)
}
Expand Down

0 comments on commit c27dfe1

Please sign in to comment.