Function
downloadStringAsFile
(
content: string,
mimeType: string,
fileName: string
)
Source from the content-addressed store, hash-verified
| 32 | } |
| 33 | |
| 34 | export function downloadStringAsFile( |
| 35 | content: string, |
| 36 | mimeType: string, |
| 37 | fileName: string |
| 38 | ) { |
| 39 | const blob = new Blob([content], { type: mimeType }) |
| 40 | const url = URL.createObjectURL(blob) |
| 41 | const a = document.createElement('a') |
| 42 | a.href = url |
| 43 | a.download = fileName |
| 44 | document.body.append(a) |
| 45 | a.click() |
| 46 | a.remove() |
| 47 | URL.revokeObjectURL(url) |
| 48 | } |
| 49 | |
| 50 | export function useIntersectionObserver( |
| 51 | elementRef: React.RefObject<Element>, |
Tested by
no test coverage detected