Sha256: a98773dd7032cacd5dda3fa675907974ac70511f712ffd8c0606792ee1e26162
Contents?: true
Size: 780 Bytes
Versions: 16
Compression:
Stored size: 780 Bytes
Contents
((exports) => { /** * Returns a function, that, as long as it continues to be invoked, will not * be triggered. The function will be called after it stops being called for * N milliseconds. * @param {Object} context - the context for the called function. * @param {Function} func - the function to be executed. * @param {int} wait - number of milliseconds to wait before executing the function. * @private * @returns {Void} - Returns nothing. */ exports.delayed = (context, func, wait) => { let timeout = null; return function(...args) { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { timeout = null; Reflect.apply(func, context, args); }, wait); } } })(window);
Version data entries
16 entries across 16 versions & 1 rubygems