I’m torn on whether to use web workers, and currently coming down on the side of No, but I’m curious what others think. Here’s my current position.
Angular style recommends all heavy lifting appear in a provider, not a page.
If you know a provider needs time to think, your page can set its values to initial placeholder values that get updated via Observable when the provider finishes thinking.
Using a web worker, by contrast, encourages the programmer to put heavy code in the page itself, and discourages the use of Observables and reactive solutions.
Thoughts? Anyone used web workers in a provider? Any benefit to this?
I currently rely on (1), and it means my page displays almost immediately, and values arrive when they are available. That seems like a better user experience than waiting for a web worker, even if a web worker executes faster than the same code not in a web worker.
Edit to add: I started a thread on this topic on the Angular repo.