Add some additional examples

This commit is contained in:
Steve Kinney
2024-10-02 08:41:56 -05:00
parent a212170602
commit 4b025e2a07
21 changed files with 355 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
export const getUser = async (id) => {
const response = await fetch(
`https://jsonplaceholder.typicode.com/users/${id}`,
);
if (!response.ok) {
throw new Error('Failed to fetch user');
}
return response.json();
};