fn-call-streak
Make sure a function gets called regularly.
Installing
npm install fn-call-streak
Usage
Let's assume you want to detect a series of calls to f
, in which each call must happen within 10ms.
const streak = const check = // threshold of 10ms const f = { const isFirst = if isFirst console}
You can pass an optional total duration of the series as a second parameter.
Look at the tests to find more examples.
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.