From a5f42043d3635cec2fb54ab31c35c4dfdb760d5f Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Thu, 21 Sep 2017 19:38:42 -0700 Subject: [PATCH] Debounce twitter calls to 5 seconds --- package.json | 2 ++ pages/editor.js | 4 +++- yarn.lock | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 88041a2..e671f9a 100644 --- a/package.json +++ b/package.json @@ -17,8 +17,10 @@ "express": "^4.15.3", "form-data": "^2.2.0", "highlight.js": "^9.12.0", + "lodash.debounce": "^4.0.8", "morgan": "^1.8.2", "morphmorph": "0.0.2", + "ms": "^2.0.0", "next": "^3.2.2", "react": "^15.6.1", "react-click-outside": "^2.3.1", diff --git a/pages/editor.js b/pages/editor.js index 1bfb4e6..19e3405 100644 --- a/pages/editor.js +++ b/pages/editor.js @@ -3,6 +3,8 @@ import React from 'react' import HTML5Backend from 'react-dnd-html5-backend' import { DragDropContext } from 'react-dnd' import domtoimage from 'dom-to-image' +import debounce from 'lodash.debounce' +import ms from 'ms' // Ours import Page from '../components/Page' @@ -111,7 +113,7 @@ class Editor extends React.Component {