Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

repeatit

twalmsley11ISC0.1.5

Create multiple repeating timed functions.

repeatr

readme

'use strict';

// Require the package
var rep = require('repeatit');

// Create the functions to be repeated
var f1 = function () {
  console.log('message1');
};

var f2 = function () {
  console.log('message2');
};

// Create the repeaters, time is in milliseconds and defaults to 1000
var x = rep.createRepeater(f1, 3000);
var y = rep.createRepeater(f2, 1000);

// Start the timers
x.start();
y.start();

// Wait a while then stop the timers.
setTimeout(function () {
  x.stop();
  y.stop();
}, 20000);