UNPKG

@freedom-editor/keybindings-controller

Version:
22 lines (18 loc) 505 B
const debounce = (callback, wait) => { let timeout return (...args) => { const context = this clearTimeout(timeout) timeout = setTimeout(() => callback.apply(context, args), wait) } } const isArrayIdentical = (arrayToCheck, arrayToCheckWith) => { if (arrayToCheck.length !== arrayToCheckWith.length) { return false } return arrayToCheck.every((currentItem, currentItemIndex) => currentItem === arrayToCheckWith[currentItemIndex]) } export { debounce, isArrayIdentical }