mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Use the built-in partial feature of modern setTimeout.
This commit is contained in:
2
defer.js
2
defer.js
@@ -16,7 +16,7 @@ function defer(func, ...args) {
|
||||
if (typeof func != 'function') {
|
||||
throw new TypeError('Expected a function');
|
||||
}
|
||||
return setTimeout(() => func(...args), 1);
|
||||
return setTimeout(func, 1, ...args);
|
||||
}
|
||||
|
||||
export default defer;
|
||||
|
||||
Reference in New Issue
Block a user