Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/usehooks-ts.ts>useInterval

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useInterval
import { useInterval } from "https://deno.land/x/netzo@0.5.63/deps/usehooks-ts.ts";

Custom hook for creating an interval that invokes a callback function at a specified delay.

Examples

const handleInterval = () => { // Code to be executed at each interval }; useInterval(handleInterval, 1000);

Parameters

callback: () => void
  • The function to be invoked at each interval.
delay: number | null
  • The time, in milliseconds, between each invocation of the callback. Use null to clear the interval.