|
|
@ -8,7 +8,7 @@ export class ${WorkerName}WorkerHelper { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 拿到helper中的worker |
|
|
|
* 拿到helper中的worker |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public get${WorkerName}MainThreadWorker() { |
|
|
|
public getWorker() { |
|
|
|
if (this.worker) { |
|
|
|
if (this.worker) { |
|
|
|
return 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() |
|
|
|
// workerHelper.getWorker() |
|
|
|
.testCommunication() |
|
|
|
// .testCommunication() |
|
|
|
.then(res => console.log(res)); |
|
|
|
// .then(res => console.log(res)); |
|
|
|