包详细信息

set-harmonic-interval

streamich8.5mUnlicense1.0.1

Works similar to setInterval, but calls all callbacks scheduled using setHarmonicInterval all at once, which have same delay in milliseconds.

自述文件

set-harmonic-interval

Works similar to setInterval, but calls all callbacks scheduled using setHarmonicInterval all at once, which have same delay in milliseconds.

Install

npm install set-harmonic-interval

Usage

In below example 1 and 2 will always be printed together every second.

const { setHarmonicInterval, clearHarmonicInterval } = require('set-harmonic-interval');

setHarmonicInterval(() => console.log(1), 1000);
setTimeout(() => {
  setHarmonicInterval(() => console.log(2), 1000);
}, 500);

License

Unlicense — public domain.

更新日志

1.0.1 (2019-10-23)

Bug Fixes

  • husky hooks now should be defined in separate package.json field; (6a444f7)
  • prettier expects doubleqotes on file template (d449a86)

1.0.0 (2019-08-25)

Features

  • 🎸 implement setHarmonicInterval and clearHarmonicInterval (2cb24b4)