Skip to content

Instantly share code, notes, and snippets.

@Ebazhanov
Created August 10, 2021 15:41
Show Gist options
  • Save Ebazhanov/f010dae7ae25e6dbc78d75dfea9636b7 to your computer and use it in GitHub Desktop.
Save Ebazhanov/f010dae7ae25e6dbc78d75dfea9636b7 to your computer and use it in GitHub Desktop.
interface IUser {
name: string;
email: string;
age: number;
isMarried: boolean;
}
const fetchData = (apiUrl: string): Promise<IUser> => {
return fetch(apiUrl)
.then((response)=> response.json())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment