Last active
January 19, 2021 12:09
-
-
Save aleksejkozin/8cb8f1c30f75ad76ce3e5bed19b7ff6d to your computer and use it in GitHub Desktop.
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
export type FetchBrowsersResults = { | |
Browsers: Browser[] | |
} | |
export type UseFetch<T> = { | |
loading: boolean | |
// We use Generic. T - is a type argument that can be any type. | |
// We can useFetch() with any type | |
// ? means, that T can be undefined | |
data?: T | |
} | |
export function useFetch<T>(url: string): UseFetch<T> {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment