@@ -113,6 +113,11 @@ export class QueryManager<TStore> {
113
113
*/
114
114
public stop ( ) {
115
115
this . scheduler . stop ( ) ;
116
+
117
+ this . queries . forEach ( ( _info , queryId ) => {
118
+ this . stopQueryNoBroadcast ( queryId ) ;
119
+ } ) ;
120
+
116
121
this . fetchQueryRejectFns . forEach ( reject => {
117
122
reject ( new Error ( 'QueryManager stopped while query was in flight' ) ) ;
118
123
} ) ;
@@ -721,9 +726,14 @@ export class QueryManager<TStore> {
721
726
}
722
727
723
728
public stopQueryInStore ( queryId : string ) {
729
+ this . stopQueryInStoreNoBroadcast ( queryId ) ;
730
+ this . broadcastQueries ( ) ;
731
+ }
732
+
733
+ private stopQueryInStoreNoBroadcast ( queryId : string ) {
734
+ this . scheduler . stopPollingQuery ( queryId ) ;
724
735
this . queryStore . stopQuery ( queryId ) ;
725
736
this . invalidate ( true , queryId ) ;
726
- this . broadcastQueries ( ) ;
727
737
}
728
738
729
739
public addQueryListener ( queryId : string , listener : QueryListener ) {
@@ -953,7 +963,12 @@ export class QueryManager<TStore> {
953
963
}
954
964
955
965
public stopQuery ( queryId : string ) {
956
- this . stopQueryInStore ( queryId ) ;
966
+ this . stopQueryNoBroadcast ( queryId ) ;
967
+ this . broadcastQueries ( ) ;
968
+ }
969
+
970
+ private stopQueryNoBroadcast ( queryId : string ) {
971
+ this . stopQueryInStoreNoBroadcast ( queryId ) ;
957
972
this . removeQuery ( queryId ) ;
958
973
}
959
974
0 commit comments