minor
Before Width: | Height: | Size: 324 KiB After Width: | Height: | Size: 320 KiB |
Before Width: | Height: | Size: 734 KiB After Width: | Height: | Size: 724 KiB |
Before Width: | Height: | Size: 281 KiB After Width: | Height: | Size: 279 KiB |
Before Width: | Height: | Size: 650 KiB After Width: | Height: | Size: 646 KiB |
|
@ -1,6 +1,6 @@
|
|||
# Events: change, input, cut, copy, paste
|
||||
|
||||
Let's discuss various events that accompany data updates.
|
||||
Let's cover various events that accompany data updates.
|
||||
|
||||
## Event: change
|
||||
|
||||
|
|
|
@ -337,3 +337,13 @@ To schedule a new microtask:
|
|||
There's no UI or network event handling between microtasks: they run immediately one after another.
|
||||
|
||||
So one may want to `queueMicrotask` to execute a function asynchronously, but also with the same application state.
|
||||
|
||||
```smart header="Web Workers"
|
||||
For long heavy calculations that shouldn't block the event loop, we can use [Web Workers](https://html.spec.whatwg.org/multipage/workers.html).
|
||||
|
||||
That's a way to run code in another, parallel thread.
|
||||
|
||||
Web Workers can exchange messages with the main process, but they have their own variables, and their own event loop.
|
||||
|
||||
Web Workers do not have access to DOM, so they are useful, mainly, for calculations, to use multiplle CPU cores simultaneously.
|
||||
```
|
||||
|
|