From b2d7fad435e40fa8736edc37dae9ba743c7cdbec Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Wed, 7 Aug 2019 20:38:01 -0700 Subject: [PATCH] perf: only update draggable x/y state at end of drag (#1379) * perf: only update draggable x/y state at end of drag This is more intelligent and more performant than using requestIdleCallback willy-nilly. We can just update the store when the user is actually done dragging the button. * remove console.log * consistent syntax --- src/routes/_components/Draggable.html | 17 ++++++----- .../components/MediaFocalPointDialog.html | 17 +++++------ src/routes/_utils/throttleTimer.js | 20 +++++++++++++ src/routes/_utils/throttleTimers.js | 28 ------------------- 4 files changed, 37 insertions(+), 45 deletions(-) create mode 100644 src/routes/_utils/throttleTimer.js delete mode 100644 src/routes/_utils/throttleTimers.js diff --git a/src/routes/_components/Draggable.html b/src/routes/_components/Draggable.html index 0b360b1b..59f6eff2 100644 --- a/src/routes/_components/Draggable.html +++ b/src/routes/_components/Draggable.html @@ -31,19 +31,17 @@