Test Datei entfernt

This commit is contained in:
ISA
2025-03-05 09:48:02 +01:00
parent e355fdc919
commit 3a21abd4bb
20 changed files with 12 additions and 396 deletions

View File

@@ -0,0 +1,16 @@
const fetchWithTimeout = (url, options, timeout = 5000) => {
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout);
return fetch(url, { ...options, signal: controller.signal })
.then((response) => {
clearTimeout(id);
return response;
})
.catch((error) => {
clearTimeout(id);
throw error;
});
};
export default fetchWithTimeout;