angular-redux / ng-redux

Angular bindings for Redux
MIT License
1.16k stars 178 forks source link

$digest may be triggered before the actual state change #212

Open cozmy opened 5 years ago

cozmy commented 5 years ago

Triggering the $digest in the middleware is a bad idea as it may happen before the actual state change. It should be triggered in store.subscribe() as this is a change listener which "will be called any time an action is dispatched, and some part of the state tree may potentially have changed".