fix(@vant/use): keep forward compatible (#9592)

This commit is contained in:
neverland 2021-09-29 18:24:31 +08:00 committed by GitHub
parent 95ffe9bc19
commit 8d9ccfd8c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,9 @@
export const inBrowser = typeof window !== 'undefined';
// Keep forward compatible
// should be removed in next major version
export const supportsPassive = true;
export function raf(fn: FrameRequestCallback): number {
return inBrowser ? requestAnimationFrame(fn) : -1;
}