isComputed

isComputed() returns true for standalone computed() values. When you pass prop, it checks whether that property on an observable object is a computed getter.

Signature

function isComputed(value: unknown, prop?: PropertyKey): boolean

Basic usage

import { computed, isComputed, observable } from "@fobx/core"

isComputed(computed(() => 42)) // true

const store = observable({
  count: 0,
  get doubled() {
    return this.count * 2
  },
})

isComputed(store, "doubled") // true

Use computed() to create computed values and isObservable() for a broader reactive-value check.