download-directory.github.io icon indicating copy to clipboard operation
download-directory.github.io copied to clipboard

Separate logic from UI

Open fregante opened this issue 7 months ago • 0 comments

  • Follows #124

I'm imagining an API like:

const download = downloadDirectory('https://github.com/refined-github/sandbox/tree/default-a/.github/workflows');

download.addEventListener('warning', updateStatus); 'retrying…' | 'It’s a large repo…' 
download.addEventListener('info', updateStatus);
download.addEventListener('download', updateStatus); // single file downloaded

try {
	const files = await download.files;
	downloadFile(zip(files))
} catch (error) {
	updateStatus(error)
}

This will eventually enable a rewrite into svelte for a better UI

fregante avatar Jul 14 '24 09:07 fregante