Initial commit
This commit is contained in:
15
wwwroot/lib/popper.js/esm/utils/debounce.js
Normal file
15
wwwroot/lib/popper.js/esm/utils/debounce.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user