Ready: false

useTimeout

Update value after a given time with controls.

Usage

import { useTimeout, promiseTimeout } from '@vueuse/core'

const { ready, start, stop } = useTimeout(1000, true)
console.log(ready.value) // false

await promisedTimeout(1200)

console.log(ready.value) // true

Type Declarations

/**
 * Update value after a given time with controls.
 *
 * @param interval
 * @param immediate
 */
export declare function useTimeout(
  interval?: number,
  immediate?: boolean
): {
  ready: Ref<boolean>
  isActive: Ref<boolean>
  start: () => void
  stop: () => void
}

Source

SourceDemoDocs