mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Remove unused debounce function
This commit is contained in:
parent
84a362a7c5
commit
044a704048
2 changed files with 2 additions and 17 deletions
|
@ -31,20 +31,6 @@ export const strRemoveWord = (str, word, separator = ',') => {
|
||||||
return arr.join(separator);
|
return arr.join(separator);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const debounce = (func, wait) => {
|
|
||||||
let timeout;
|
|
||||||
return function() {
|
|
||||||
const context = this;
|
|
||||||
const args = arguments;
|
|
||||||
const later = function() {
|
|
||||||
timeout = null;
|
|
||||||
func.apply(context, args);
|
|
||||||
};
|
|
||||||
clearTimeout(timeout);
|
|
||||||
timeout = setTimeout(later, wait);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export const throttle = (func, limit) => {
|
export const throttle = (func, limit) => {
|
||||||
let inThrottle, lastArgs, lastContext;
|
let inThrottle, lastArgs, lastContext;
|
||||||
|
|
||||||
|
@ -77,7 +63,6 @@ const Utils = {
|
||||||
keysToCamelCase,
|
keysToCamelCase,
|
||||||
strAddWord,
|
strAddWord,
|
||||||
strRemoveWord,
|
strRemoveWord,
|
||||||
debounce,
|
|
||||||
throttle
|
throttle
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,8 @@ class Renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(document)
|
jQuery(document)
|
||||||
.off('ppcp-reload-buttons', wrapper)
|
.off(this.reloadEventName, wrapper)
|
||||||
.on('ppcp-reload-buttons', wrapper, (event, settingsOverride = {}) => {
|
.on(this.reloadEventName, wrapper, (event, settingsOverride = {}) => {
|
||||||
const settings = merge(this.defaultSettings, settingsOverride);
|
const settings = merge(this.defaultSettings, settingsOverride);
|
||||||
let scriptOptions = keysToCamelCase(settings.url_params);
|
let scriptOptions = keysToCamelCase(settings.url_params);
|
||||||
scriptOptions = merge(scriptOptions, settings.script_attributes);
|
scriptOptions = merge(scriptOptions, settings.script_attributes);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue