All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.utils.debounce.js Maven / Gradle / Ivy

There is a newer version: 2.11.8
Show newest version
export default function debounce(fn) {
  var pending;
  return function () {
    if (!pending) {
      pending = new Promise(function (resolve) {
        Promise.resolve().then(function () {
          pending = undefined;
          resolve(fn());
        });
      });
    }

    return pending;
  };
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy