062eae35757a5e3b4cbd422763edace3e0f44f44
1 // TODO: https://github.com/webpack-contrib/worker-loader
2 // https://stackoverflow.com/questions/48713072/how-to-get-js-function-into-webworker-via-importscripts
3 // For asynchronous computer move search
5 //self.addEventListener('message', (e) =>
6 onmessage
= async
function(e
)
11 const vModule
= await
import("@/variants/" + e
.data
[1] + ".js");
12 self
.V
= vModule
.VariantRules
;
15 const fen
= e
.data
[1];
16 self
.vr
= new self
.V(fen
);
19 self
.vr
.play(e
.data
[1]);
22 const compMove
= self
.vr
.getComputerMove();
23 postMessage(compMove
);