On this page
useIntervalFn
Category | Animation |
---|---|
Export Size | 341 B |
Last Changed | last week |
Wrapper for setInterval
with controls
Usage
import { useIntervalFn } from '@vueuse/core'
const { pause, resume, isActive } = useIntervalFn(() => {
/* your function */
}, 1000)
Type Declarations
export interface UseIntervalFnOptions {
/**
* Start the timer immediately
*
* @default true
*/
immediate?: boolean
/**
* Execute the callback immediate after calling this function
*
* @default false
*/
immediateCallback?: boolean
}
/**
* Wrapper for `setInterval` with controls
*
* @param cb
* @param interval
* @param options
*/
export declare function useIntervalFn(
cb: Fn,
interval?: MaybeRefOrGetter<number>,
options?: UseIntervalFnOptions
): Pausable
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/shared/useIntervalFn/