Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple way to check if redux state changed

I have a story reducer with state that constantly changes based on actions that users perform, I'd like to show "Save changes" indicator when story gets changed and the only way I can think about to do this is to attach something to each action that changes state to know if it was performed hence affected state of the story. However, I have a lot of these and it would be better if there was a simple way to check if redux state changed and show "Save changes" indicator based on that.

like image 772
Ilja Avatar asked Oct 22 '25 02:10

Ilja


1 Answers

It sounds like maybe you just want to subscribe to dispatches on the store and check if state has actually changed from the last time and show your indicator based on that.

like image 86
JMM Avatar answered Oct 24 '25 07:10

JMM