Hello

useIntervalFn

Wrapper for setInterval with controls

Usage

import { useIntervalFn } from '@vueuse/core'

const { start, stop } = useIntervalFn(() => {
  /* your function */
}, 1000)

Type Declarations

export interface IntervalFnReturn extends Pausable {
  /**
   * @deprecated use pause() instead
   */
  stop: Fn
  /**
   * @deprecated use resume() instead
   */
  start: Fn
}
/**
 * Wrapper for `setInterval` with controls
 *
 * @param cb
 * @param interval
 * @param immediate
 */
export declare function useIntervalFn(
  cb: Fn,
  interval?: number,
  immediate?: boolean
): IntervalFnReturn

Source

SourceDemoDocs