Created
December 15, 2021 06:44
-
-
Save jyotiarora2610/7ef7aab84a781d9ac4c98cb5b9e3b872 to your computer and use it in GitHub Desktop.
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
export async function fetchUtility({ url, headers, method }) { | |
try { | |
const response = await fetch(url, { ...headers }, method); | |
return response.json(); | |
} catch(err) { | |
console.log("error", err); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment