Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.js « store « visual_review_toolbar « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5cf145351b3490f16b9fd6beea4e8d7c4739c757 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const debounce = (fn, time) => {
  let current;

  const debounced = () => {
    if (current) {
      clearTimeout(current);
    }

    current = setTimeout(fn, time);
  };

  return debounced;
};

export default debounce;