after.js 221 B

123456789
  1. // Returns a function that will only be executed on and after the Nth call.
  2. export default function after(times, func) {
  3. return function() {
  4. if (--times < 1) {
  5. return func.apply(this, arguments);
  6. }
  7. };
  8. }