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
4 onmessage = function(e
)
12 '@/variants/' + e
.data
[1] + '.js');
13 self
.V
= eval("VariantRules");
16 const fen
= e
.data
[1];
17 self
.vr
= new VariantRules(fen
);
20 self
.vr
.play(e
.data
[1]);
23 const compMove
= self
.vr
.getComputerMove();
24 postMessage(compMove
);