Sha256: e94c1d8179a6670e819ff143656b52f3c05d20b764ba701a68cb78c97777a137

Contents?: true

Size: 202 Bytes

Versions: 27

Compression:

Stored size: 202 Bytes

Contents

export default function (func, delay) {
  let timeout

  return function (...args) {
    const that = this

    clearTimeout(timeout)
    timeout = setTimeout(() => func.apply(that, args), delay)
  }
}

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
alchemy_cms-7.3.4 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.3.3 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.3.2 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.7 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.3.1 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.3.0 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.6 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.5 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.12 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.4 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.11 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.3 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.10 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.2 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.9 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.2.1 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.8 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.7 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.6 app/javascript/alchemy_admin/utils/debounce.js
alchemy_cms-7.1.5 app/javascript/alchemy_admin/utils/debounce.js