diff --git a/examples/00-example-basic/src/api/userAPI.js b/examples/00-example-basic/src/api/userAPI.js index 17274bd..81f412e 100644 --- a/examples/00-example-basic/src/api/userAPI.js +++ b/examples/00-example-basic/src/api/userAPI.js @@ -1,8 +1,15 @@ import { fetchWithDelay } from './fetch'; const url = 'https://jsonplaceholder.typicode.com/users'; -const fetchUsers = () => fetchWithDelay(url); +const fetchUsers = async () =>{ +try { + const users =await fetchWithDelay(url); + return users; +} catch(error){ + throw new Error(error); +} +} export const userAPI = { fetchUsers, -}; \ No newline at end of file +};