8000 bring back the rAF · openwings/vue@e0fbc20 · GitHub
[go: up one dir, main page]

Skip to content

Commit e0fbc20

Browse files
author
Evan You
committed
bring back the rAF
1 parent e422d95 commit e0fbc20

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ var config = require('./config'),
22
toString = ({}).toString,
33
win = window,
44
console = win.console,
5-
timeout = win.setTimeout,
65
def = Object.defineProperty,
76
OBJECT = 'object',
87
THIS_RE = /[^\w]this[^\w]/,
98
hasClassList = 'classList' in document.documentElement,
109
ViewModel // late def
1110

11+
var defer =
12+
win.requestAnimationFrame ||
13+
win.webkitRequestAnimationFrame ||
14+
win.setTimeout
15+
1216
var utils = module.exports = {
1317

1418
/**
@@ -225,7 +229,7 @@ var utils = module.exports = {
225229
* used to defer batch updates
226230
*/
227231
nextTick: function (cb) {
228-
timeout(cb, 0)
232+
defer(cb, 0)
229233
},
230234

231235
/**

0 commit comments

Comments
 (0)
0