mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
refactor(nuxt): simplify request
computation (#26191)
This commit is contained in:
parent
5d3cbff6ac
commit
79cdb0b881
@ -94,13 +94,7 @@ export function useFetch<
|
||||
) {
|
||||
const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
|
||||
|
||||
const _request = computed(() => {
|
||||
let r = request
|
||||
if (typeof r === 'function') {
|
||||
r = r()
|
||||
}
|
||||
return toValue(r)
|
||||
})
|
||||
const _request = computed(() => toValue(request))
|
||||
|
||||
const _key = opts.key || hash([autoKey, typeof _request.value === 'string' ? _request.value : '', ...generateOptionSegments(opts)])
|
||||
if (!_key || typeof _key !== 'string') {
|
||||
|
Loading…
Reference in New Issue
Block a user