Writing a wrapper for useFetch
Hey!
We'd like to write some helper wrappers for useFetch (for example to call Ghost CMS endpoints for posts, or pages, all with their own composable abstracted.
I'm wondering how do you correctly type the fetch options? I just want to pass the type through
1 Reply
Oh, it's just passing in a generic, isn't it? 🤦♂️
export default function useGhostData<T>(url: string, options: UseFetchOptions<T>) {
should do it