Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/useIntervalFn.md
1---2category: Animation3---45# useIntervalFn67Wrapper for `setInterval` with controls89## Usage1011```ts12import { useIntervalFn } from '@vueuse/core'1314const { pause, resume, isActive } = useIntervalFn(() => {15/* your function */16}, 1000)17```1819## Type Declarations2021```ts22export interface UseIntervalFnOptions {23/**24* Start the timer immediately25*26* @default true27*/28immediate?: boolean29/**30* Execute the callback immediately after calling `resume`31*32* @default false33*/34immediateCallback?: boolean35}36export type UseIntervalFnReturn = Pausable37/**38* Wrapper for `setInterval` with controls39*40* @see https://vueuse.org/useIntervalFn41* @param cb42* @param interval43* @param options44*/45export declare function useIntervalFn(46cb: Fn,47interval?: MaybeRefOrGetter<number>,48options?: UseIntervalFnOptions,49): UseIntervalFnReturn50```51