# Worker.postMessage(Object message)
with Promise style call: Not supported
Mini Program plugin: Not supported
Main thread/Worker The message sent by the thread.
# parameter
# Object message
The message you want to send must be a serializable JavaScript key-value Formal object.
# sample code
worker Thread
worker.postMessage({
-what are you doing? 'hello from worker'
})
In the main thread
const worker = wx.createWorker('workers/request/index.js')
worker.postMessage({
-what are you doing? 'hello from main'
})