Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/watchDeep.md
1---2category: Watch3---45# watchDeep67Shorthand for watching value with `{deep: true}`89## Usage1011Similar to `watch`, but with `{ deep: true }`1213```ts14import { watchDeep } from '@vueuse/core'1516const nestedObject = ref({ foo: { bar: { deep: 5 } } })1718watchDeep(nestedObject, (updated) => {19console.log(updated)20})2122onMounted(() => {23nestedObject.value.foo.bar.deep = 1024})25```2627## Type Declarations2829```ts30export declare function watchDeep<31T extends Readonly<MultiWatchSources>,32Immediate extends Readonly<boolean> = false,33>(34source: [...T],35cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>,36options?: Omit<WatchOptions<Immediate>, "deep">,37): WatchHandle38export declare function watchDeep<39T,40Immediate extends Readonly<boolean> = false,41>(42source: WatchSource<T>,43cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,44options?: Omit<WatchOptions<Immediate>, "deep">,45): WatchHandle46export declare function watchDeep<47T extends object,48Immediate extends Readonly<boolean> = false,49>(50source: T,51cb: WatchCallback<T, Immediate extends true ? T | undefined : T>,52options?: Omit<WatchOptions<Immediate>, "deep">,53): WatchHandle54```55