Skip to content

A React hook to implement useInterval logics thit more tool to control how often the callback is called

Notifications You must be signed in to change notification settings

wind198/use-interval-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use Interval hook

Introduction

This hook is allow trigger callback on interval in React with ease (which often cause a lot of pain relating to closures), also it return function that allow more control over how often the callback is called

Example

import useInterval from "use-interval-hook";

callback = ()=>{
  console.log("Hello world!");
}

const {
    pause,
    activate,
    stop,
    timeLapse,
  } = useInterval({
  interval: 1000;
  callback,
  delay: 2000;
  })

About

A React hook to implement useInterval logics thit more tool to control how often the callback is called

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published