2025-01-22 16:18:30 +01:00

17 lines
336 B
Haxe

package kha;
class Worker {
public static function postMessage(m: Dynamic): Void {
try {
js.Syntax.code("self.postMessage(m)");
}
catch (e:Dynamic) {
trace(e);
}
}
public static function handleMessages(messageHandler: Dynamic->Void) {
untyped js.Syntax.code("self.onmessage = messageHandler");
}
}