8000 Merge pull request #2200 from Jinjiang/feature-next-tick · mircle/vue@e4accfc · GitHub
[go: up one dir, main page]

Skip to content

Commit e4accfc

Browse files
committed
Merge pull request vuejs#2200 from Jinjiang/feature-next-tick
improve nextTick by setImmediate
2 parents 69d4d45 + 38accc1 commit e4accfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/util/env.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const nextTick = (function () {
7070
copies[i]()
7171
}
7272
}
73+
7374
/* istanbul ignore if */
7475
if (typeof MutationObserver !== 'undefined') {
7576
var counter = 1
@@ -82,6 +83,8 @@ export const nextTick = (function () {
8283
counter = (counter + 1) % 2
8384
textNode.data = counter
8485
}
86+
} else if (typeof setImmediate === 'function') {
87+
timerFunc = setImmediate
8588
} else {
8689
timerFunc = setTimeout
8790
}

0 commit comments

Comments
 (0)
0