Created JS function to fetch static JSON. Now loads data Asynchronously :)

This commit is contained in:
2023-09-05 19:03:59 +01:00
parent 79795bc060
commit b2b56480b8
4 changed files with 27 additions and 7 deletions

5
src/lib/data.ts Normal file
View File

@ -0,0 +1,5 @@
export async function getJson(path: string) {
let response = await fetch(path);
let users = await response.json();
return users;
}