artdaq_node_server  v1_00_09
 All Classes Namespaces Files Variables Pages
after.js
1 var toInteger = require('./toInteger');
2 
4 var FUNC_ERROR_TEXT = 'Expected a function';
5 
30 function after(n, func) {
31  if (typeof func != 'function') {
32  throw new TypeError(FUNC_ERROR_TEXT);
33  }
34  n = toInteger(n);
35  return function() {
36  if (--n < 1) {
37  return func.apply(this, arguments);
38  }
39  };
40 }
41 
42 module.exports = after;