3.0.3 • Published 4 years ago

interval-actions v3.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

CircleCI

Similar to debounce/throttle, but callbacks will be added to queue and called with provided interval. First callback call is invoked immediately. Note, last callback call wont cause timeout and prevent process from exiting immediately.

Install

$ npm i --save interval-actions

Usage

const {interval} = require('interval-actions');

const logWithInterval = interval(console.timeLog, 1000);

console.time('time');

logWithInterval('time'); // time: 0.405ms
logWithInterval('time'); // time: 1005.094ms
logWithInterval('time'); // time: 2006.982ms

process.on('exit', () => {
	console.timeEnd('time'); // time: 2007.645ms
});

Api

paramtypedescription
fnFunctioncallback function
timenumberinterval duration in ms
3.0.3

4 years ago

3.0.2

4 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.0

6 years ago