Closed lahdekorpi closed 6 years ago
Just to confirm, adding:
if(typeof e === "object" && e.data === "string") {
try {
e.data = JSON.parse(e.data);
} catch(e) {
console.error("Could not parse messageData", e);
}
}
Works perfectly and the demo starts working (shows the IP address).
version 0.2.0 of node-worker does two things:
hope this works better for you now.
https://github.com/WebReflection/benja/blob/5a4bfd00863c03dae232d65746a93a7401020368/os/qml/workers/utils.js#L6
With the demo, I'm getting an object with a data-key containing a JSON string, like:
{ data: '{"name":"ipv6"}'}
Should we parse the string here or is it a job if the NodeWorker?