mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
fix(nuxt): update useFetch
key warning to include any function or blob (#5710)
* fix(nuxt): update `useFetch` key warning to include any function or blob * Update packages/nuxt/src/app/composables/fetch.ts Co-authored-by: pooya parsa <pyapar@gmail.com>
This commit is contained in:
parent
490d686fe6
commit
f09d1d88da
@ -26,8 +26,8 @@ export function useFetch<
|
||||
request: Ref<ReqT> | ReqT | (() => ReqT),
|
||||
opts: UseFetchOptions<_ResT, Transform, PickKeys> = {}
|
||||
) {
|
||||
if (process.dev && opts.transform && !opts.key) {
|
||||
console.warn('[nuxt] You should provide a key for `useFetch` when using a custom transform function.')
|
||||
if (process.dev && !opts.key && Object.values(opts).some(v => typeof v === 'function' || v instanceof Blob)) {
|
||||
console.warn('[nuxt] [useFetch] You should provide a key when passing options that are not serializable to JSON:', opts)
|
||||
}
|
||||
const key = '$f_' + (opts.key || hash([request, { ...opts, transform: null }]))
|
||||
const _request = computed(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user