Skip to content

Commit

Permalink
Ensuring that flushing does not occur more than once. Fixes davidkpia…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano authored and peterox committed Oct 26, 2017
1 parent 2962565 commit dd333e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/debounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ export default function debounce(func, delay) {
const createLaterFunc = (args) => () => {
timeout = null;
func.apply(null, args);

// Only run the deferred function once
laterFunc = undefined;
};

const debouncedFunc = (...args) => {
Expand Down

0 comments on commit dd333e5

Please sign in to comment.