I see a couple of examples that Jason Teplitz has written about using web workers in Angular 2. The Angular 4 CLI now supports platform-worker that runs the app in a worker thread. The factorial example is a good example of that. Or this step-by-step example.
Using platform-worker guarantee that all the long computational operations run in a web worker? Or should I create another angular module (not the app module) which uses the platform-worker to run the long computation operation? As a result there will be two modules, one for the app and the other for the long operation?
Should I create separate
Workerlike in this example to create worker threads?How can I update the UI with the progress of the operation? I assume if the long operation is done in a for loop, it wont get the chance to let the UI know about the progress until that loop is complete? Should I split the long operation into multiple small operations and update the UI?