update, text, response
This commit is contained in:
36
node_modules/timers-ext/README.md
generated
vendored
36
node_modules/timers-ext/README.md
generated
vendored
@@ -1,6 +1,5 @@
|
||||
[![Build status][nix-build-image]][nix-build-url]
|
||||
[![Windows status][win-build-image]][win-build-url]
|
||||
![Transpilation status][transpilation-image]
|
||||
[![Build status][build-image]][build-url]
|
||||
[![Tests coverage][cov-image]][cov-url]
|
||||
[![npm version][npm-image]][npm-url]
|
||||
|
||||
# timers-ext
|
||||
@@ -30,19 +29,17 @@ Makes sure to execute _fn_ function only once after a defined interval of time (
|
||||
|
||||
```javascript
|
||||
var nextTick = require("next-tick");
|
||||
var logFoo = function() {
|
||||
console.log("foo");
|
||||
};
|
||||
var logFoo = function () { console.log("foo"); };
|
||||
var logFooOnce = require("timers-ext/once")(logFoo);
|
||||
|
||||
logFooOnce();
|
||||
logFooOnce(); // ignored, logFoo will be logged only once
|
||||
logFooOnce(); // ignored
|
||||
|
||||
nextTick(function() {
|
||||
logFooOnce(); // Invokes another log (as tick passed)
|
||||
logFooOnce(); // ignored
|
||||
logFooOnce(); // ignored
|
||||
nextTick(function () {
|
||||
logFooOnce(); // Invokes another log (as tick passed)
|
||||
logFooOnce(); // ignored
|
||||
logFooOnce(); // ignored
|
||||
});
|
||||
```
|
||||
|
||||
@@ -52,18 +49,21 @@ Validates timeout value.
|
||||
For `NaN` resolved _timeout_ `0` is returned.
|
||||
If _timeout_ resolves to a number:
|
||||
|
||||
- for _timeout < 0_ `0` is returned
|
||||
- for _0 >= timeout <= [MAX_TIMEOUT](#max_timeout-timers-extmax-timeout)_, `timeout` value is returned
|
||||
- for _timeout > [MAX_TIMEOUT](#max_timeout-timers-extmax-timeout)_ exception is thrown
|
||||
- for _timeout < 0_ `0` is returned
|
||||
- for _0 >= timeout <= [MAX_TIMEOUT](#max_timeout-timers-extmax-timeout)_, `timeout` value is returned
|
||||
- for _timeout > [MAX_TIMEOUT](#max_timeout-timers-extmax-timeout)_ exception is thrown
|
||||
|
||||
### Tests
|
||||
|
||||
$ npm test
|
||||
|
||||
[nix-build-image]: https://semaphoreci.com/api/v1/medikoo-org/timers-ext/branches/master/shields_badge.svg
|
||||
[nix-build-url]: https://semaphoreci.com/medikoo-org/timers-ext
|
||||
[win-build-image]: https://ci.appveyor.com/api/projects/status/2i5nerowov2ho3o9?svg=true
|
||||
[win-build-url]: https://ci.appveyor.com/project/medikoo/timers-ext
|
||||
[transpilation-image]: https://img.shields.io/badge/transpilation-free-brightgreen.svg
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
|
||||
|
||||
[build-image]: https://github.com/medikoo/timers-ext/workflows/Integrate/badge.svg
|
||||
[build-url]: https://github.com/medikoo/timers-ext/actions?query=workflow%3AIntegrate
|
||||
[cov-image]: https://img.shields.io/codecov/c/github/medikoo/timers-ext.svg
|
||||
[cov-url]: https://codecov.io/gh/medikoo/timers-ext
|
||||
[npm-image]: https://img.shields.io/npm/v/timers-ext.svg
|
||||
[npm-url]: https://www.npmjs.com/package/timers-ext
|
||||
|
||||
Reference in New Issue
Block a user