Image/ data flickering(flashing) when update

Hi all,

I tried to do polling for every 10 seconds, to get the latest status of the device by calling API. However, when I get data from the API, I will update the existing data (Array, at html using ngfor) and render to UI, it will cause the image flickering. Any idea on this issue? Or it just my bad coding?

Thanks.

I suspect that you are completely replacing the array that your UI is using. That destruction of the data, will trigger the removal of the elements to be replaced with the new data.

You might want to look at inserting the data into the existing array without a complete overwrite.

That should resolve the flicker. Good luck