INNER CODE UNIT · TypeScript

idx

SurgeDM/Surge · extension/entrypoints/popup/store/index.ts:64

    const idx = prev.findIndex(d => d.id === dl.id);
    if (idx >= 0) {
      const next = [...prev];
      next[idx] = { ...next[idx], ...dl };
      return next;
    }
    return [...prev, dl];
  });
}

export function removeActiveDownload(id: string): void {
  setActiveDownloads(prev => prev.filter(d => d.id !== id));
}

// History downloads: capped to 100 entries by background handler.
const [historyDownloads, setHistoryDownloads] = createSignal<HistoryEntry[]>([]);
export { historyDownloads, setHistoryDownloads };

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…