-
Notifications
You must be signed in to change notification settings - Fork 0
Reactivator API: isReactive()
Appurist (Paul) edited this page Sep 17, 2020
·
1 revision
Parameters: (obj)
Returns: true
if the specified argument (obj
) was previously returned by reactive()
This boolean method can be used to check if an object is a reactivator reactive object.
import { ref, isRef, isReactive } from 'reactivator'
const THING = { field1: 42, field2: 'hello'}
let thing = reactive(THING)
console.log("isReactive(THING) is", isReactive(THING));
console.log("isReactive(thing) is", isReactive(thing));
console.log("isRef(thing) is", isRef(thing));
isReactive(THING) is false
isReactive(thing) is true
isRef(thing) is false