File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -289,3 +289,23 @@ export const position = el => /* istanbul ignore next: getBoundingClientRect() d
289
289
left : _offset . left - parentOffset . left - parseFloat ( elStyles . marginLeft )
290
290
}
291
291
}
292
+
293
+ // requestAnimationFrame convenience method
294
+ let rAF = cb => {
295
+ // Fallback, but not a true polyfill.
296
+ // But all browsers we support (other than Opera Mini) support rAF
297
+ // without a polyfil
298
+ /* istanbul ignore next */
299
+ return setTimeout ( cb , 16 )
300
+ }
301
+ if ( inBrowser ) {
302
+ /* istanbul ignore next */
303
+ rAF =
304
+ window . requestAnimationFrame ||
305
+ window . webkitRequestAnimationFrame ||
306
+ window . mozRequestAnimationFrame ||
307
+ window . msRequestAnimationFrame ||
308
+ window . oRequestAnimationFrame ||
309
+ rAF
310
+ }
311
+ export const requestAF = rAF
You can’t perform that action at this time.
0 commit comments