mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Make worker self.onmessage into classic function
This commit is contained in:
parent
8b15f2580b
commit
ada3aec3f6
1 changed files with 10 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
import { AppScan } from './scan.mjs'
|
import { AppScan } from './scan.mjs'
|
||||||
|
|
||||||
self.onmessage = async ( event ) => {
|
self.onmessage = ( event ) => {
|
||||||
|
|
||||||
console.log( 'Worker received message', event )
|
console.log( 'Worker received message', event )
|
||||||
|
|
||||||
|
|
@ -24,15 +24,15 @@ self.onmessage = async ( event ) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
await scan.start()
|
scan.start()
|
||||||
|
.then( () => {
|
||||||
|
self.postMessage( {
|
||||||
self.postMessage( {
|
status: 'finished',
|
||||||
status: 'finished',
|
// Convert App Scan instance to a more primitive Object
|
||||||
// Convert App Scan instance to a more primitive Object
|
// so that it's clonneable for our worker
|
||||||
// so that it's clonneable for our worker
|
scan: JSON.parse(JSON.stringify( scan ))
|
||||||
scan: JSON.parse(JSON.stringify( scan ))
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue