Skip to content

Commit

Permalink
fix: ssr queueMicrotask error
Browse files Browse the repository at this point in the history
  • Loading branch information
fupengl committed Jul 4, 2022
1 parent 9df6b09 commit 076a628
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/function/next-tick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import type { AnyFn } from '../type';

function _nextTick(): (callback: Function, ...args: any[]) => void {
// nodejs
if (typeof process === 'object' && process && isFunction(process.nextTick)) {
if (isFunction(typeof process === 'object' && process && process.nextTick)) {
return process.nextTick;
}

if (isFunction(queueMicrotask)) {
if (isFunction(typeof queueMicrotask == 'function' && queueMicrotask)) {
return function (cb) {
queueMicrotask(ensureCallable(cb));
};
}

if (isFunction(setImmediate)) {
if (isFunction(typeof setImmediate === 'function' && setImmediate)) {
return function (cb, ...args) {
setImmediate(ensureCallable<AnyFn>(cb), ...args);
};
Expand Down

0 comments on commit 076a628

Please sign in to comment.