From 7a89c7818534e7ad277549abbe322d628dd2498b Mon Sep 17 00:00:00 2001 From: Johan van Eck Date: Wed, 12 Jun 2019 21:26:44 +0200 Subject: [PATCH] Fix specs --- src/runtime/internal/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runtime/internal/utils.ts b/src/runtime/internal/utils.ts index c961768eb0..e63daf64a4 100644 --- a/src/runtime/internal/utils.ts +++ b/src/runtime/internal/utils.ts @@ -87,7 +87,7 @@ export function once(fn) { if (ran) return; ran = true; fn.call(this, ...args); - } + }; } const is_client = typeof window !== 'undefined'; @@ -96,7 +96,9 @@ export let now: () => number = is_client ? () => window.performance.now() : () => Date.now(); -export let raf = is_client ? requestAnimationFrame.bind(window) : noop; +export let raf = (callback) => is_client && window.requestAnimationFrame + ? window.requestAnimationFrame.apply(window, callback) + : undefined; // used internally for testing export function set_now(fn) {