MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / after

Function after

MathBox/mathbox-bundle.js:40271–40280  ·  view source on GitHub ↗

* Creates a function that executes `func`, with the `this` binding and * arguments of the created function, only after being called `n` times. * * @static * @memberOf _ * @category Functions * @param {number} n The number of times the function must be called before

(n, func)

Source from the content-addressed store, hash-verified

40269 * // => logs 'Done saving!', after all saves have completed
40270 */
40271 function after(n, func) {
40272 if (!isFunction(func)) {
40273 throw new TypeError;
40274 }
40275 return function() {
40276 if (--n < 1) {
40277 return func.apply(this, arguments);
40278 }
40279 };
40280 }
40281
40282 /**
40283 * Creates a function that, when called, invokes `func` with the `this`

Callers

nothing calls this directly

Calls 1

isFunctionFunction · 0.70

Tested by

no test coverage detected