main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
599 bytes
|
Line | |
---|
1 | # set-harmonic-interval
|
---|
2 |
|
---|
3 | Works similar to `setInterval`, but calls all callbacks scheduled using `setHarmonicInterval` all at once, which have same
|
---|
4 | delay in milliseconds.
|
---|
5 |
|
---|
6 | ## Install
|
---|
7 |
|
---|
8 | ```
|
---|
9 | npm install set-harmonic-interval
|
---|
10 | ```
|
---|
11 |
|
---|
12 | ## Usage
|
---|
13 |
|
---|
14 | In below example `1` and `2` will always be printed together every second.
|
---|
15 |
|
---|
16 | ```js
|
---|
17 | const { setHarmonicInterval, clearHarmonicInterval } = require('set-harmonic-interval');
|
---|
18 |
|
---|
19 | setHarmonicInterval(() => console.log(1), 1000);
|
---|
20 | setTimeout(() => {
|
---|
21 | setHarmonicInterval(() => console.log(2), 1000);
|
---|
22 | }, 500);
|
---|
23 | ```
|
---|
24 |
|
---|
25 |
|
---|
26 | ## License
|
---|
27 |
|
---|
28 | [Unlicense](LICENSE) — public domain.
|
---|
Note:
See
TracBrowser
for help on using the repository browser.