MCPcopy Create free account
hub / github.com/Vishal-raj-1/Awesome-JavaScript-Projects / _getJSON

Method _getJSON

assets/js/weatherApp.js:49–63  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

47 }
48
49 async _getJSON(url) {
50 try {
51 const response = await fetch(url);
52 console.log(response)
53
54 if (!response.ok) throw new Error(`${response.statusText} (${response.status})`)
55
56 const data = await response.json();
57
58 return data;
59 }
60 catch (err) {
61 throw err;
62 }
63 }
64
65 _renderData(data) {
66 const markup = this._generateMarkup(data);

Callers 1

_getWeatherMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected