Skip to content

useTimeoutFn

Package
Share
Category
Description
wrapper for `setTimeout` with controls

Wrapper for setTimeout with controls.

Demo

Please wait for 3 seconds

Usage

js
import { useTimeoutFn } from '@hungpvq/shared-core';

const { isPending, start, stop } = useTimeoutFn(() => {
  /* ... */
}, 3000);