INNER CODE UNIT · TypeScript
methodNames
andywer/threads.js · src/worker/index.ts:183
const methodNames = Object.keys(exposed).filter(key => typeof exposed[key] === "function")
postModuleInitMessage(methodNames)
} else {
throw Error(`Invalid argument passed to expose(). Expected a function or an object, got: ${exposed}`)
}
Implementation.subscribeToMasterMessages(messageData => {
if (isMasterJobCancelMessage(messageData)) {
const jobUID = messageData.uid
const subscription = activeSubscriptions.get(jobUID)
if (subscription) {
subscription.unsubscribe()
activeSubscriptions.delete(jobUID)
}
}
})
}