There was an error while loading. Please reload this page.
1 parent 5adecde commit c893d1fCopy full SHA for c893d1f
2 files changed
js/main.js
@@ -35,7 +35,6 @@ let ctxAssociate = canvasAssociate.getContext('2d')
35
36
wx.setPreferredFramesPerSecond(60)
37
38
-let worker = wx.createWorker('js/worker/index.js')
39
40
export default class Main {
41
constructor () {
@@ -49,7 +48,7 @@ export default class Main {
49
48
50
this.dataBus = window.dataBus
51
52
- this.worker = worker
+ this.worker = wx.createWorker('/js/worker/index.js')
53
54
this.pluginFuncs = pluginFuncs
55
@@ -79,6 +78,7 @@ export default class Main {
79
78
this.pluginFuncs()
80
81
this.loop()
+ console.log(window.main)
82
}
83
84
loop() {
js/worker/index.js
@@ -1 +1,3 @@
1
-let a = 1
+worker.onMessage(function (res) {
2
+ console.log(res)
3
+})
0 commit comments