expose() called in the master thread.
I believe the issue is since its compiling my electron main file and the worker file all in one file it's yelling at me since its all on the master thread or am i incorrect?
main.ts
async function test() {
const auth = await spawn(new Worker("./workers/worker.ts", { type: 'module' }))
const hashed = await auth.hashPassword("Super secret password", "1234")
console.log("Hashed password:", hashed)
await Thread.terminate(auth)
}
test().catch(console.error)
worker.ts
import { expose } from "threads/worker";
export const newtest = () => { console.log('creating file') }
const hashPassword = (testm, ag) => {
return 'yes running'
}
expose(hashPassword)
I believe the issue is since its compiling my electron main file and the worker file all in one file it's yelling at me since its all on the master thread or am i incorrect?
main.tsworker.ts