From 71c297bab735ef06d2de0643a95ea9ee28b64479 Mon Sep 17 00:00:00 2001 From: Noah Loomans Date: Fri, 16 Feb 2018 22:34:54 +0100 Subject: Debounce the getMeetingpointData promise --- package.json | 1 + src/server/lib/getMeetingpointData.js | 2 +- yarn.lock | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b5a774..bf5e80d 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "moment": "^2.20.1", "morgan": "~1.7.0", "node-sass": "^4.7.2", + "promise-debounce": "^1.0.1", "prop-types": "^15.6.0", "query-string": "^5.0.1", "react": "^16.2.0", diff --git a/src/server/lib/getMeetingpointData.js b/src/server/lib/getMeetingpointData.js index 64e8500..e50fe5f 100644 --- a/src/server/lib/getMeetingpointData.js +++ b/src/server/lib/getMeetingpointData.js @@ -111,4 +111,4 @@ function getMeetingpointData() { return Promise.resolve(meetingpointData); } -module.exports = getMeetingpointData; +module.exports = debounce(getMeetingpointData); diff --git a/yarn.lock b/yarn.lock index 10dc919..a482674 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6016,6 +6016,10 @@ progress@~1.1.8: version "1.1.8" resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +promise-debounce@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/promise-debounce/-/promise-debounce-1.0.1.tgz#6ed76f8f79d0144fdbd01cc15589ce57f9d71e78" + promise@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/promise/-/promise-6.1.0.tgz#2ce729f6b94b45c26891ad0602c5c90e04c6eef6" -- cgit v1.1