mirror of
https://github.com/maputnik/editor.git
synced 2026-08-25 14:37:27 +00:00
Apply suggestions from code review
This commit is contained in:
@@ -11,10 +11,10 @@ function loadJSON(url: string, defaultValue: any, cb: (...args: any[]) => void)
|
|||||||
}
|
}
|
||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then((body) =>{
|
.then((body) => {
|
||||||
cb(body)
|
cb(body)
|
||||||
})
|
})
|
||||||
.catch(() =>{
|
.catch(() => {
|
||||||
console.warn('Can not load metadata for ' + url + ', using default value ' + defaultValue);
|
console.warn('Can not load metadata for ' + url + ', using default value ' + defaultValue);
|
||||||
cb(defaultValue)
|
cb(defaultValue)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user