docs: tiny update on example message-ports.md (#39884)

Update message-ports.md

fix multiplying object * a number. It would multiply number * number.
This commit is contained in:
Fredy Whatley 2023-09-21 10:46:23 -05:00 committed by GitHub
parent 56e45baeb8
commit 7c2df8860b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -365,7 +365,7 @@ window.onmessage = (event) => {
// process.
port.onmessage = (event) => {
console.log('from main process:', event.data)
port.postMessage(event.data * 2)
port.postMessage(event.data.test * 2)
}
}
}