Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Исправляет описание работы с worker #5564

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions js/web-workers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ worker.postMessage({ message: '415-ый, я база, ответьте' })
```js
// Воркер: worker.js
onmessage = function (e) { // Слушаем сообщения из основного потока
if (e.message === '415-ый, я база, ответьте') {
{/* Отправляем сообщение из воркера в основной поток */}
if (e.data.message === '415-ый, я база, ответьте') {
// Отправляем сообщение из воркера в основной поток
postMessage('База, это 415-ый, как слышно?')
}
}
Expand All @@ -71,7 +71,7 @@ const worker = new Worker('worker.js')
worker.postMessage({ message: '415-ый, я база, ответьте' })

worker.onmessage = function (e) { // Слушаем сообщения из воркера
console.log(e)
console.log(e.data)
// База, это 415-ый, как слышно?
}
```
Expand Down
Loading