aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-02-16 22:34:54 +0100
committerNoah Loomans <noahloomans@gmail.com>2018-02-16 22:34:54 +0100
commit71c297bab735ef06d2de0643a95ea9ee28b64479 (patch)
treec2861152423fd78174df800b8ef05e675d197d0e
parent065c798078586b98f974c4f8ee2d1a7af1ad9218 (diff)
Debounce the getMeetingpointData promise
-rw-r--r--package.json1
-rw-r--r--src/server/lib/getMeetingpointData.js2
-rw-r--r--yarn.lock4
3 files changed, 6 insertions, 1 deletions
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"