react-interval-hook
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

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

/react-interval-hook/

    Package Sidebar

    Install

    npm i react-interval-hook

    Weekly Downloads

    2,586

    Version

    1.1.5

    License

    MIT

    Unpacked Size

    7.06 kB

    Total Files

    9

    Last publish

    Collaborators

    • minwork