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 4ef0573b55
commit dcc6aa000a
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;
}