From ffafc680a62ebfaf644d425e8e2bb3020e3fd459 Mon Sep 17 00:00:00 2001 From: Zacharias Enochsson Date: Thu, 12 May 2022 14:49:41 +0200 Subject: [PATCH] remove settimeout fallback (#1093) --- index.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/index.js b/index.js index fb9a501..36f82bd 100644 --- a/index.js +++ b/index.js @@ -7,10 +7,6 @@ var SVG_NS = "http://www.w3.org/2000/svg" var id = (a) => a var map = EMPTY_ARR.map var isArray = Array.isArray -var enqueue = - typeof requestAnimationFrame !== "undefined" - ? requestAnimationFrame - : setTimeout var createClass = (obj) => { var out = "" @@ -380,7 +376,7 @@ export var app = ({ if (state !== newState) { if ((state = newState) == null) dispatch = subscriptions = render = id if (subscriptions) subs = patchSubs(subs, subscriptions(state), dispatch) - if (view && !busy) enqueue(render, (busy = true)) + if (view && !busy) requestAnimationFrame(render, (busy = true)) } }