Skip to content

Commit 0048b4f

Browse files
committed
fix: try to fix zombie queries
1 parent 5a9e645 commit 0048b4f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/mobx-inifinite-query.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ export class MobxInfiniteQuery<
164164

165165
this.abortController.signal.addEventListener('abort', () => {
166166
subscription();
167+
168+
this.queryObserver.getCurrentQuery().destroy();
167169
this.queryObserver.destroy();
170+
this.isResultRequsted = false;
168171

169172
if (resetOnDispose) {
170173
this.reset();

src/mobx-query.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ export class MobxQuery<
149149

150150
this.abortController.signal.addEventListener('abort', () => {
151151
subscription();
152+
153+
this.queryObserver.getCurrentQuery().destroy();
152154
this.queryObserver.destroy();
153155
this.isResultRequsted = false;
154156

0 commit comments

Comments
 (0)