On this page
useTimeoutFn
Category | Animation |
---|---|
Export Size | 303 B |
Last Changed | 2 weeks ago |
Wrapper for setTimeout
with controls.
Usage
import { useTimeoutFn } from '@vueuse/core'
const { isPending, start, stop } = useTimeoutFn(() => {
/* ... */
}, 3000)
Type Declarations
export interface UseTimeoutFnOptions {
/**
* Start the timer immediate after calling this function
*
* @default true
*/
immediate?: boolean
}
/**
* Wrapper for `setTimeout` with controls.
*
* @param cb
* @param interval
* @param options
*/
export declare function useTimeoutFn<CallbackFn extends AnyFn>(
cb: CallbackFn,
interval: MaybeRefOrGetter<number>,
options?: UseTimeoutFnOptions
): Stoppable<Parameters<CallbackFn> | []>
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/shared/useTimeoutFn/