npm.io
1.1.5 • Published 1 year ago

react-interval-hook

Licence
MIT
Version
1.1.5
Deps
0
Size
7 kB
Vulns
0
Weekly
0
Stars
67

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

Keywords