We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 511aebd commit 1e7c3edCopy full SHA for 1e7c3ed
packages/runtime-core/src/scheduler.ts
@@ -63,13 +63,14 @@ export function nextTick<T = void, R = void>(
63
const p = currentFlushPromise || resolvedPromise
64
let wrapperFn: ((this: T) => R | Promise<R> | undefined) | undefined = fn
65
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
+ wrapperFn = fn
+ ? function () {
+ if (currentFlushPromise) {
+ return currentFlushPromise.then(fn.bind(this))
+ }
+ return fn.call(this)
73
+ : void 0
74
}
75
return wrapperFn ? p.then(this ? wrapperFn.bind(this) : wrapperFn) : p
76
0 commit comments