Skip to content

Commit 5100f3e

Browse files
committed
setTimeout(0) is faster than rAF
1 parent 1a05dea commit 5100f3e

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/directives/repeat.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,11 @@ module.exports = {
229229
if (this.queued) return
230230
this.queued = true
231231
var self = this
232-
setTimeout(function () {
232+
utils.nextTick(function () {
233233
if (!self.compiler) return
234234
self.compiler.parseDeps()
235235
self.queued = false
236-
}, 0)
236+
})
237237
},
238238

239239
/**

src/utils.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ var config = require('./config'),
44
join = [].join,
55
win = window,
66
console = win.console,
7-
7+
timeout = win.setTimeout,
88
hasClassList = 'classList' in document.documentElement,
99
ViewModel // late def
1010

11-
var defer =
12-
win.requestAnimationFrame ||
13-
win.webkitRequestAnimationFrame ||
14-
win.setTimeout
15-
1611
var utils = module.exports = {
1712

1813
/**
@@ -195,7 +190,7 @@ var utils = module.exports = {
195190
* used to defer batch updates
196191
*/
197192
nextTick: function (cb) {
198-
defer(cb, 0)
193+
timeout(cb, 0)
199194
},
200195

201196
/**

0 commit comments

Comments
 (0)