-
-
Save StephenDRoberts/c1206e70d076edefe07de8c88c6bab7f to your computer and use it in GitHub Desktop.
Generic Axios Fetcher
This file contains 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 axios from 'axios'; | |
export async function get<T>( | |
path: string | |
): Promise<T> { | |
const { data } = await axios.get(path); | |
return data; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment