Manual cleanup of src/runtime/internal/environment.js

pull/8569/head
S. Elliott Johnson 3 years ago
parent 30c36a3d1d
commit 9ac958a77a

@ -1,13 +1,18 @@
import { noop } from './utils';
import { noop } from './utils.js';
export const is_client = typeof window !== 'undefined';
/** @type {() => number} */
export let now = is_client ? () => window.performance.now() : () => Date.now();
export let raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;
// used internally for testing
/** @returns {void} */
export function set_now(fn) {
now = fn;
}
/** @returns {void} */
export function set_raf(fn) {
raf = fn;

Loading…
Cancel
Save