Prettified all files.
This commit is contained in:
+6
-7
@@ -14,7 +14,7 @@ function onerror(event) {
|
||||
}
|
||||
|
||||
function load() {
|
||||
loadQueue.forEach((url) => {
|
||||
loadQueue.forEach(url => {
|
||||
let xhr = new XMLHttpRequest()
|
||||
xhr.responseType = 'blob'
|
||||
xhr.onload = onload
|
||||
@@ -25,11 +25,11 @@ function load() {
|
||||
})
|
||||
}
|
||||
|
||||
self.onmessage = (event) => {
|
||||
self.onmessage = event => {
|
||||
let msg = event.data
|
||||
switch(msg.command) {
|
||||
switch (msg.command) {
|
||||
case 'load':
|
||||
for(let url of msg.urls) {
|
||||
for (let url of msg.urls) {
|
||||
console.log('Load', url)
|
||||
loadQueue.push(url)
|
||||
}
|
||||
@@ -37,13 +37,12 @@ self.onmessage = (event) => {
|
||||
break
|
||||
case 'abort':
|
||||
loadQueue = []
|
||||
for(let xhr of pendingRequests.values()) {
|
||||
for (let xhr of pendingRequests.values()) {
|
||||
console.log('Abort')
|
||||
xhr.abort()
|
||||
}
|
||||
break
|
||||
default:
|
||||
console.warn('Unknown worker command: ' + msg.command)
|
||||
console.warn('Unknown worker command: ' + msg.command)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user