I am able to retrieve data from my api and store in localStorage and display on my views. But when there is change, how can my localStorage update itself? I understand it is a bad practice to call API's everytime you land on a page. I store data in a localStorage but my issue is, when there is a change in the data in the server side, how can i detect it i am using localStorage to display data in my views.
How can i update my localStorage anytime there is a change or update in the API / server side ?