jszip
jszip copied to clipboard
i want to save jszip in localStorage when browser refresh,but i don‘t know how to generateAsync localStorage jszip
import JSZip from 'jszip'
let zip = new JSZip()
const cache = JSON.parse(localStorage.getItem('zip'))
const email = localStorage.getItem('email')
if (cache) {
const { files } = cache
zip.files = files
zip.generateAsync({ type: 'blob' }).then(function (blob) {
saveAs(blob, `${email}.zip`)
})
localStorage.removeItem('zip')
return
}
error
Uncaught (in promise) TypeError: t._compressWorker is not a function
What am I supposed to do?