assign data before returning value
This commit is contained in:
@@ -3,7 +3,8 @@ let data;
|
||||
function getConfig() {
|
||||
if (data) return Promise.resolve(data);
|
||||
return fetch("/config.json?nocache=" + new Date().getUTCMilliseconds()).then(function (response) {
|
||||
return response.json();
|
||||
data = response.json();
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user