source: imaps-frontend/node_modules/set-harmonic-interval/README.md

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
3Works similar to `setInterval`, but calls all callbacks scheduled using `setHarmonicInterval` all at once, which have same
4delay in milliseconds.
5
6## Install
7
8```
9npm install set-harmonic-interval
10```
11
12## Usage
13
14In below example `1` and `2` will always be printed together every second.
15
16```js
17const { setHarmonicInterval, clearHarmonicInterval } = require('set-harmonic-interval');
18
19setHarmonicInterval(() => console.log(1), 1000);
20setTimeout(() => {
21 setHarmonicInterval(() => console.log(2), 1000);
22}, 500);
23```
24
25
26## License
27
28[Unlicense](LICENSE) &mdash; public domain.
Note: See TracBrowser for help on using the repository browser.