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>
42 lines
1020 B
Markdown
42 lines
1020 B
Markdown
---
|
|
category: Watch
|
|
---
|
|
|
|
# watchOnce
|
|
|
|
Shorthand for watching value with `{ once: true }`. Once the callback fires once, the watcher will be stopped.
|
|
See [Vue's docs](https://vuejs.org/guide/essentials/watchers.html#once-watchers) for full details.
|
|
|
|
## Usage
|
|
|
|
Similar to `watch`, but with `{ once: true }`
|
|
|
|
```ts
|
|
import { watchOnce } from '@vueuse/core'
|
|
|
|
watchOnce(source, () => {
|
|
// triggers only once
|
|
console.log('source changed!')
|
|
})
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
export declare function watchOnce<T extends Readonly<MultiWatchSources>>(
|
|
source: [...T],
|
|
cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>,
|
|
options?: Omit<WatchOptions<true>, "once">,
|
|
): WatchHandle
|
|
export declare function watchOnce<T>(
|
|
source: WatchSource<T>,
|
|
cb: WatchCallback<T, T | undefined>,
|
|
options?: Omit<WatchOptions<true>, "once">,
|
|
): WatchHandle
|
|
export declare function watchOnce<T extends object>(
|
|
source: T,
|
|
cb: WatchCallback<T, T | undefined>,
|
|
options?: Omit<WatchOptions<true>, "once">,
|
|
): WatchHandle
|
|
```
|