Skip to content
On this page

reactiveComputed

Category
Last Changed
5 months ago

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

This function uses Proxy

It is NOT supported by IE 11 or below.

Usage

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

/**
 * 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

SourceDocs

Contributors

Anthony Fu
qiang

Changelog

v7.7.0 on 2/26/2022
3b507 - feat(reactiveOmit): add reactiveOmit (#1292)
fcfec - feat: new function
reactiveComputed has loaded