This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 'download-blob.js', inspired by this gist: | |
// 'dreamyguy/downloadFile.js' https://gist.github.com/dreamyguy/6b4ab77d2f118adb8a63c4a03fba349d | |
// I added some handler to make it works in Chrome, Safari, and Firefox on iOS | |
const downloadBlob = ( | |
result, | |
defaultFilename = 'content.dat', | |
mime = 'application/octet-stream' | |
) => { | |
if (window && result && result.data) { |