Back to Vueuse

reactiveComputed

packages/shared/reactiveComputed/index.md

14.3.0319 B
Original Source

reactiveComputed

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

Usage

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

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

state.bar // 'baz'