FY
Size: a a a
FY
Б
let _dataCache = {};
export default async function myFetcher(path, opts) {
const url = new URL(`${API_URL}${path}`);
const cacheKey = url.toString();
if (!_dataCache[cacheKey]) {
_dataCache[cacheKey] = await fetch(`${url}`, {
method: 'POST',
credentials: 'same-origin',
...opts,
headers
})
.then(r => r.json())
.then(data => data);
}
const data = _dataCache[cacheKey];
Б
L
A
倫岡
let _dataCache = {};
export default async function myFetcher(path, opts) {
const url = new URL(`${API_URL}${path}`);
const cacheKey = url.toString();
if (!_dataCache[cacheKey]) {
_dataCache[cacheKey] = await fetch(`${url}`, {
method: 'POST',
credentials: 'same-origin',
...opts,
headers
})
.then(r => r.json())
.then(data => data);
}
const data = _dataCache[cacheKey];
Б
.then(data => JSON.stringify(data));
Б
L
A
AS
L
L4
D
L
A
V
AE
V
VK