Skip to content

Commit 1e7c3ed

Browse files
author
yangchangtao
committed
chore: update
1 parent 511aebd commit 1e7c3ed

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/runtime-core/src/scheduler.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ export function nextTick<T = void, R = void>(
6363
const p = currentFlushPromise || resolvedPromise
6464
let wrapperFn: ((this: T) => R | Promise<R> | undefined) | undefined = fn
6565
if (!currentFlushPromise) {
66-
wrapperFn = function () {
67-
if (!fn) return
68-
if (currentFlushPromise) {
69-
return currentFlushPromise.then(fn.bind(this))
70-
}
71-
return fn.call(this)
72-
}
66+
wrapperFn = fn
67+
? function () {
68+
if (currentFlushPromise) {
69+
return currentFlushPromise.then(fn.bind(this))
70+
}
71+
return fn.call(this)
72+
}
73+
: void 0
7374
}
7475
return wrapperFn ? p.then(this ? wrapperFn.bind(this) : wrapperFn) : p
7576
}

0 commit comments

Comments
 (0)