You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
270 B
16 lines
270 B
3 months ago
|
|
||
|
class GetJson {
|
||
|
constructor(url) {
|
||
|
this.url = url;
|
||
|
this.items = [];
|
||
|
}
|
||
|
|
||
|
async theData() {
|
||
|
const resp = await fetch(this.url);
|
||
|
console.assert(resp.status == 200, "failed to get it");
|
||
|
this.items = await resp.json();
|
||
|
return this.items;
|
||
|
}
|
||
|
}
|
||
|
|