In this blog we will create a setup to get streaming data from backend and log it in the frontend. The ideal solution today to handle streaming data is through WebSocket. But initialising the WebSocket in the main thread would slow down the website and make it feel laggy since constantly it would be handling the server data that is pushed in through the WebSocket.

One way to do this efficiently is by initialising the WebSocket inside a WebWorker. To be brief, WebWorker does not execute in the main thread instead it will be executed in a separate thread in…

John Peter

Senior Software Engineer — Frontend @Freshworks.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store