Created JS function to fetch static JSON. Now loads data Asynchronously :)
This commit is contained in:
5
src/lib/data.ts
Normal file
5
src/lib/data.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export async function getJson(path: string) {
|
||||
let response = await fetch(path);
|
||||
let users = await response.json();
|
||||
return users;
|
||||
}
|
Reference in New Issue
Block a user