Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
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.66/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.