@terra-dev/use-interval
v0.20.1
Published
Simple `setInterval()` wrapper hook.
Downloads
46
Readme
@terra-dev/use-interval
Simple setInterval()
wrapper hook.
import { useInterval } from '@terra-dev/use-interval';
function Component() {
const [tick, setTick] = useState(0);
useInterval(() => {
setTick((prev) => prev + 1);
}, 1000);
return <div>{tick}</div>;
}