Skip to content

Instantly share code, notes, and snippets.

@banyucenter
Created November 22, 2020 06:46
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 banyucenter/d5bf9d7ea3a8b70228f8e760b7188b30 to your computer and use it in GitHub Desktop.
Save banyucenter/d5bf9d7ea3a8b70228f8e760b7188b30 to your computer and use it in GitHub Desktop.
const getMoviesFromApiAsync = async () => {
try {
let response = await fetch(
'https://reactnative.dev/movies.json'
);
let json = await response.json();
return json.movies;
} catch (error) {
console.error(error);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment