mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
[improvement] optimize utils (#3104)
This commit is contained in:
@@ -19,10 +19,10 @@ function fallback(fn: FrameRequestCallback): number {
|
||||
const root = <Window>(isServer ? global : window);
|
||||
|
||||
/* istanbul ignore next */
|
||||
const iRaf = root.requestAnimationFrame || root.webkitRequestAnimationFrame || fallback;
|
||||
const iRaf = root.requestAnimationFrame || fallback;
|
||||
|
||||
/* istanbul ignore next */
|
||||
const iCancel = root.cancelAnimationFrame || root.webkitCancelAnimationFrame || root.clearTimeout;
|
||||
const iCancel = root.cancelAnimationFrame || root.clearTimeout;
|
||||
|
||||
export function raf(fn: FrameRequestCallback): number {
|
||||
return iRaf.call(root, fn);
|
||||
|
Reference in New Issue
Block a user