UNPKG

@vizzly-testing/cli

Version:

Visual review platform for UI developers and designers

9 lines 271 B
function fetchWithTimeout(url, opts = {}, ms = 300000) { const ctrl = new AbortController(); const id = setTimeout(() => ctrl.abort(), ms); return fetch(url, { ...opts, signal: ctrl.signal }).finally(() => clearTimeout(id)); } export { fetchWithTimeout };