export function downloadBlob()

in src/common/helper.js [51:63]


export function downloadBlob(blob, fileName) {
  // for IE
  if (typeof window.navigator.msSaveBlob === 'function') {
    window.navigator.msSaveOrOpenBlob(blob, fileName);
  } else {
    const a = document.createElement('a');
    a.href = URL.createObjectURL(blob);
    a.download = fileName;
    a.click();
    // should revoke the blob url after the download
    URL.revokeObjectURL(a.href);
  }
}