Skip to content
On this page

reactiveComputed

Computed reactive object. Instead of returning a ref that computed does, reactiveComputed returns a reactive object.

This function uses Proxy

It is NOT supported by IE 11 or below.

Usage

ts
import { reactiveComputed } from '@vueuse/core'

const state = reactiveComputed(() => {
  return {
    foo: 'bar',
    bar: 'baz',
  }
})

state.bar // 'baz'
import { reactiveComputed } from '@vueuse/core'

const state = reactiveComputed(() => {
  return {
    foo: 'bar',
    bar: 'baz',
  }
})

state.bar // 'baz'

Type Declarations

typescript
/**
 * Computed reactive object.
 */
export declare function reactiveComputed<T extends {}>(fn: () => T): T
/**
 * Computed reactive object.
 */
export declare function reactiveComputed<T extends {}>(fn: () => T): T

Source

Category
Export Size
342 B
Last Changed
last year

SourceDocs

贡献者(Contributors)

日志(Changelog)

No recent changes

Released under the MIT License.