React Interval Hook

React self-correcting interval hook for precision timing, augmented by management methods
Main features
- Self-correcting (explanation)
- Manageable (start, stop, isActive)
- Thoroughly tested
Installation
yarn add react-interval-hook
or
npm install --save react-interval-hook
Basic usage
import React from 'react'; // No longer necessary in newer React versions
import { useInterval } from 'react-interval-hook';
export const Example = () => {
useInterval(() => {
console.log('I am called every second');
});
return null;
};
Documentation
Full documentation can be found here
Support
If you like my work, consider making a donation through Github Sponsors.
License
MIT minwork