Add utilities and initial test coverage
This commit is contained in:
1 parent
a86723004b
commit
ff0b2959b5
15 files changed
+462
-160
No files matched your search
@@ -0,0 +1,15 @@
|
||||
export const isOnline = () => {
|
||||
if (typeof navigator !== 'undefined' && 'onLine' in navigator) {
|
||||
return navigator.onLine;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
export const triggerDownload = (blob: Blob, filename: string) => {
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = filename;
|
||||
link.click();
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
Reference in new issue
Block a user