export function isEqual(x, y) { if (x === y) { return true; } else if ( typeof x === "object" && x !== null && typeof y === "object" && y !== null ) { const keysX = Object.keys(x); const keysY = Object.keys(y); if (keysX.length !== keysY.length) { return false; } for (const key of keysX) { if (!isEqual(x[key], y[key])) { return false; } } return true; } else { return false; } } export function debounce(fn, wait) { let timer; return function () { let _this = this; let args = arguments; if (timer) { clearTimeout(timer); } timer = setTimeout(function () { fn.apply(_this, args); }, wait); }; } export function throttle(fn, wait) { let timer; return function () { let _this = this; let args = arguments; if (!timer) { timer = setTimeout(function () { timer = null; fn.apply(_this, args); }, wait); } }; } function isObject(value) { const type = typeof value return value != null && (type === 'object' || type === 'function') } export default isObject