Skip to content

Instantly share code, notes, and snippets.

@rodoabad
Created August 7, 2016 02:59
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 rodoabad/7c14144c3624e0f7151d73cb0e0c1656 to your computer and use it in GitHub Desktop.
Save rodoabad/7c14144c3624e0f7151d73cb0e0c1656 to your computer and use it in GitHub Desktop.
import 'isomorphic-fetch';
export const getFruits = async() => {
const endPoint = '/fruits';
try {
const response = await fetch(endPoint);
return await response.json();
} catch (error) {
return await Promise.reject(error.json());
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment