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