Skip to content

Instantly share code, notes, and snippets.

@StephenDRoberts
Created August 21, 2020 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenDRoberts/c1206e70d076edefe07de8c88c6bab7f to your computer and use it in GitHub Desktop.
Save StephenDRoberts/c1206e70d076edefe07de8c88c6bab7f to your computer and use it in GitHub Desktop.
Generic Axios Fetcher
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