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/reactifyObject.md
1---2category: Reactivity3---45# reactifyObject67Apply `reactify` to an object89## Usage1011```ts12import { reactifyObject } from '@vueuse/core'1314const reactifiedConsole = reactifyObject(console)1516const a = ref('42')1718reactifiedConsole.log(a) // no longer need `.value`19```2021## Type Declarations2223```ts24export type ReactifyNested<25T,26Keys extends keyof T = keyof T,27S extends boolean = true,28> = {29[K in Keys]: T[K] extends AnyFn ? Reactified<T[K], S> : T[K]30}31export type ReactifyObjectReturn<32T,33Keys extends keyof T,34S extends boolean = true,35> = ReactifyNested<T, Keys, S>36export interface ReactifyObjectOptions<37T extends boolean,38> extends ReactifyOptions<T> {39/**40* Includes names from Object.getOwnPropertyNames41*42* @default true43*/44includeOwnProperties?: boolean45}46/**47* Apply `reactify` to an object48*49* @__NO_SIDE_EFFECTS__50*/51export declare function reactifyObject<T extends object, Keys extends keyof T>(52obj: T,53keys?: (keyof T)[],54): ReactifyObjectReturn<T, Keys, true>55export declare function reactifyObject<56T extends object,57S extends boolean = true,58>(59obj: T,60options?: ReactifyObjectOptions<S>,61): ReactifyObjectReturn<T, keyof T, S>62```63