fix(runtime-core): scheduler should allow intentional self triggering effects

fix #1727
This commit is contained in:
Evan You 2020-07-28 12:29:43 -04:00
parent 730e39eb76
commit c27dfe1d09

View File

@ -26,7 +26,7 @@ export function nextTick(fn?: () => void): Promise<void> {
} }
export function queueJob(job: Job) { export function queueJob(job: Job) {
if (!queue.includes(job, flushIndex)) { if (!queue.includes(job, flushIndex + 1)) {
queue.push(job) queue.push(job)
queueFlush() queueFlush()
} }
@ -43,7 +43,7 @@ export function queuePostFlushCb(cb: Function | Function[]) {
if (!isArray(cb)) { if (!isArray(cb)) {
if ( if (
!pendingPostFlushCbs || !pendingPostFlushCbs ||
!pendingPostFlushCbs.includes(cb, pendingPostFlushIndex) !pendingPostFlushCbs.includes(cb, pendingPostFlushIndex + 1)
) { ) {
postFlushCbs.push(cb) postFlushCbs.push(cb)
} }