Skip to content

Instantly share code, notes, and snippets.

View kyoncy's full-sized avatar
👻
work work walk

kyoncy kyoncy

👻
work work walk
View GitHub Profile
/**
* TODO: Need to add error handling and then submit pull request to 'blob-util'
* library.
*/
export function objectURLToBlob(url) {
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.responseType = 'blob';
xhr.onreadystatechange = () => {