isComputedRef(any)
What problem does this feature solve?
There is already isRef utility to check variable is Ref.. but as I am using refs in my composable as readonly, so I am supporting also computedRefs as input... pattern taken from docs:
if (isRef(url)) {
// setup reactive re-fetch if input URL is a ref
watchEffect(doFetch)
} else {
// otherwise, just fetch once
// and avoid the overhead of a watcher
doFetch()
}
So I want to augment that not only if (isRef(url))
but also if (isComputedRef(url))`
What does the proposed API look like?
It can be either separate util:
isComputedRef()
or it could be parameter of isRef(url, true)