after.js 221 B

12345678
  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. }