function func() {
fetch('bla-bla-bla')
.then(data => data.json())
.then(data => data)
}
const func = (() => {
const url = 'bla-bla-bla';
let result;
return async () => {
if (typeof result == 'undefined') {
result = await (() => {
return fetch(url).then(response => response.json());
})();
}
return result;
};
})();