3.1.1 • Published 5 years ago

holding v3.1.1

Weekly downloads
88
License
MIT
Repository
github
Last release
5 years ago

holding

Holding a callback for some times

NPM Version Download Status Dependencies

Installation

$ npm install holding

API

const holding = require('holding');
const done = holding(2, function() {
  console.log(this, 'called');
}, this);

done();
done();
done(); // it works

done.times; // show called times
done.called; // show fn call status

holding(n, fn, context)

  • n - {Number}

    holding times, it will execute fn after n times.

  • fn - {Function}

    holding callback.

  • context - {Any}

    fn context.

holding(n, fn, context).times

  • show called times.

holding(n, fn, context).called

  • show fn call status.

holding.assert(n, fn, context)

  • function for assertion testing, will throw error if call times out of range.

License

MIT

3.1.1

5 years ago

3.1.0

5 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago