export function promisifyXHR(xhr) {
return new Promise((resolve, reject) => {
xhr.addEventListener(`loadend`, (e) => {
if(xhr.status == 200) {
resolve(xhr)
} else {
reject(xhr)
}
})
})
}
export function promisifyXHR(xhr) {
return new Promise((resolve, reject) => {
xhr.addEventListener(`loadend`, (e) => {
if(xhr.status == 200) {
resolve(xhr)
} else {
reject(xhr)
}
})
})
}