|
|
|
@ -8,7 +8,7 @@ export class ${WorkerName}WorkerHelper {
|
|
|
|
|
/** |
|
|
|
|
* 拿到helper中的worker |
|
|
|
|
*/ |
|
|
|
|
public get${WorkerName}MainThreadWorker() { |
|
|
|
|
public getWorker() { |
|
|
|
|
if (this.worker) { |
|
|
|
|
return this.worker; |
|
|
|
|
} |
|
|
|
@ -38,8 +38,8 @@ export class ${WorkerName}WorkerHelper {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 使用示例 |
|
|
|
|
const workerHelper = new ${WorkerName}WorkerHelper(); |
|
|
|
|
// const workerHelper = new ${WorkerName}WorkerHelper(); |
|
|
|
|
|
|
|
|
|
workerHelper.get${WorkerName}MainThreadWorker() |
|
|
|
|
.testCommunication() |
|
|
|
|
.then(res => console.log(res)); |
|
|
|
|
// workerHelper.getWorker() |
|
|
|
|
// .testCommunication() |
|
|
|
|
// .then(res => console.log(res)); |
|
|
|
|