Skip to content

Commit

Permalink
refactor(nuxt): simplify request computation (#26191)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mini-ghost committed Mar 11, 2024
1 parent 5d3cbff commit 79cdb0b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/nuxt/src/app/composables/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 79cdb0b

Please sign in to comment.