mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 12:25:15 +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);
|
||||
};
|
||||
|
||||
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) => {
|
||||
let inThrottle, lastArgs, lastContext;
|
||||
|
||||
|
@ -77,7 +63,6 @@ const Utils = {
|
|||
keysToCamelCase,
|
||||
strAddWord,
|
||||
strRemoveWord,
|
||||
debounce,
|
||||
throttle
|
||||
};
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ class Renderer {
|
|||
}
|
||||
|
||||
jQuery(document)
|
||||
.off('ppcp-reload-buttons', wrapper)
|
||||
.on('ppcp-reload-buttons', wrapper, (event, settingsOverride = {}) => {
|
||||
.off(this.reloadEventName, wrapper)
|
||||
.on(this.reloadEventName, wrapper, (event, settingsOverride = {}) => {
|
||||
const settings = merge(this.defaultSettings, settingsOverride);
|
||||
let scriptOptions = keysToCamelCase(settings.url_params);
|
||||
scriptOptions = merge(scriptOptions, settings.script_attributes);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue