chore: update client check for smaller bundle size

pull/12975/head
Ben McCann 2 years ago
parent b579c5c06c
commit d8f59fd0c1

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: update client check for smaller bundle size

@ -1,11 +1,11 @@
/** @import { Raf } from '#client' */
import { noop } from '../shared/utils.js';
const is_client = typeof window !== 'undefined';
import { BROWSER } from 'esm-env';
const request_animation_frame = is_client ? requestAnimationFrame : noop;
const request_animation_frame = BROWSER ? requestAnimationFrame : noop;
const now = is_client ? () => performance.now() : () => Date.now();
const now = BROWSER ? () => performance.now() : () => Date.now();
/** @type {Raf} */
export const raf = {

Loading…
Cancel
Save