Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 1.55 KB

README.md

File metadata and controls

56 lines (37 loc) · 1.55 KB

React Interval Hook

codecov npm type definitions NPM Downloads npm npm bundle size

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