Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
76 lines
1.4 KiB
Markdown
76 lines
1.4 KiB
Markdown
---
|
|
category: Animation
|
|
---
|
|
|
|
# useTimeout
|
|
|
|
Update value after a given time with controls.
|
|
|
|
## Usage
|
|
|
|
```ts
|
|
import { useTimeout } from '@vueuse/core'
|
|
|
|
const ready = useTimeout(1000)
|
|
```
|
|
|
|
```ts
|
|
import { useTimeout } from '@vueuse/core'
|
|
// ---cut---
|
|
const { ready, start, stop } = useTimeout(1000, { controls: true })
|
|
```
|
|
|
|
```ts
|
|
import { promiseTimeout } from '@vueuse/core'
|
|
|
|
console.log(ready.value) // false
|
|
|
|
await promiseTimeout(1200)
|
|
|
|
console.log(ready.value) // true
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
export interface UseTimeoutOptions<Controls extends boolean>
|
|
extends UseTimeoutFnOptions {
|
|
/**
|
|
* Expose more controls
|
|
*
|
|
* @default false
|
|
*/
|
|
controls?: Controls
|
|
/**
|
|
* Callback on timeout
|
|
*/
|
|
callback?: Fn
|
|
}
|
|
export type UseTimeoutReturn =
|
|
| ComputedRef<boolean>
|
|
| ({
|
|
readonly ready: ComputedRef<boolean>
|
|
} & Stoppable)
|
|
/**
|
|
* @deprecated use UseTimeoutReturn instead
|
|
*/
|
|
export type UseTimoutReturn = UseTimeoutReturn
|
|
/**
|
|
* Update value after a given time with controls.
|
|
*
|
|
* @see {@link https://vueuse.org/useTimeout}
|
|
* @param interval
|
|
* @param options
|
|
*/
|
|
export declare function useTimeout(
|
|
interval?: MaybeRefOrGetter<number>,
|
|
options?: UseTimeoutOptions<false>,
|
|
): ComputedRef<boolean>
|
|
export declare function useTimeout(
|
|
interval: MaybeRefOrGetter<number>,
|
|
options: UseTimeoutOptions<true>,
|
|
): {
|
|
ready: ComputedRef<boolean>
|
|
} & Stoppable
|
|
```
|