mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
michaelficarra's proposed tweak to _.after
This commit is contained in:
@@ -512,7 +512,7 @@
|
|||||||
// Returns a function that will only be executed after being called N times.
|
// Returns a function that will only be executed after being called N times.
|
||||||
_.after = function(times, func) {
|
_.after = function(times, func) {
|
||||||
return function() {
|
return function() {
|
||||||
if (--times === 0) { return func.apply(this, arguments); }
|
if (--times < 1) { return func.apply(this, arguments); }
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user