Created
March 24, 2025 12:30
-
-
Save randercarlos/470ef5eaae9d1360cdf1a7c49eb38c94 to your computer and use it in GitHub Desktop.
Custom UseFetch from Nuxt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { UseFetchOptions } from 'nuxt/app' | |
| export function useCustomFetch<T>( | |
| url: string | (() => string), | |
| options: UseFetchOptions<T> = {}, | |
| ) { | |
| return useFetch(url, { | |
| ...options, | |
| $fetch: useNuxtApp().$customFetch, | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment