Web Workers allow browser operations to take place outside the main thread. Once created, communication between threads is made by passing messages. In this recipe, we'll see how to create a very simple worker, and send it a message from the main thread.
Performing work on separate threads with Web Workers
Getting ready
This recipe assumes that you already have a workspace that allows you to create and run ES modules in your browser. If you don't, please see the first two chapters.
How to do it...
- Open your command-line application and navigate to your...