As I am using NgRx in this current app and we do not run anything purposefully outside of NgZone we can add a check. The following meta reducer checks that every event that updates the store is in Angular's zone. Reverting my fix and adding this makes it very easy to locate the source of my issue.
//NgRx Meta Reducer to assert always in NgZoneexportfunctionassertInNgZoneMetaReducer(reducer){returnfunction(state:State,action:Action):State{NgZone.assertInAngularZone();returnreducer(state,action);};}
As I am using NgRx in this current app and we do not run anything purposefully outside of NgZone we can add a check. The following meta reducer checks that every event that updates the store is in Angular's zone. Reverting my fix and adding this makes it very easy to locate the source of my issue.
As of v9 this is now built in!
NgRx 9: Introducing strictActionWithinNgZone runtime check
Stephen Cooper ・ Mar 10 ・ 3 min read