UNPKG

vue-hooks-plus

Version:
26 lines (25 loc) 684 B
import { Ref } from 'vue'; declare function useInterval( /** * The function to be executed every `delay` milliseconds. */ fn: () => void, /** * The time in milliseconds, the timer should delay in between executions of the specified function. The timer will be cancelled if delay is set to `undefined`. */ delay: Ref<number | undefined> | number | undefined, options?: { /** * Whether the function should be executed immediately on first execution. */ immediate?: boolean; }): { /** * Clear the interval timer. */ clear: VoidFunction; /** * Restart the interval timer. */ restart: VoidFunction; }; export default useInterval;