mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
_.after(0, callback) now fires callback immediately
This commit is contained in:
@@ -595,9 +595,9 @@
|
||||
|
||||
// Returns a function that will only be executed after being called N times.
|
||||
_.after = function(times, func) {
|
||||
return function() {
|
||||
return times ? function() {
|
||||
if (--times < 1) { return func.apply(this, arguments); }
|
||||
};
|
||||
} : func();
|
||||
};
|
||||
|
||||
// Object Functions
|
||||
|
||||
Reference in New Issue
Block a user