In React we use dependancy array to watch the changes and run some piece of code accordingly. what if I need to run a function when there is no more changes and the application is in a stable state? Is there a way to achieve this?
For example, I have a language key on the redux state. This value might be updated after an api call is complete, might be updated from url's query params or might be updated from local storage and it all depends on the page that user will land on and some other logic, but eventually the language value will be set and will not be changed until user click some button.
I need to be notified each time that redux state reaches that stable state until some other event is fired that causes a state update.
Any suggestion?