Skip to content

Commit bb05cc3

Browse files
committed
fix: destroy hooks
1 parent 60e008b commit bb05cc3

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/mobx-inifinite-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ export class MobxInfiniteQuery<
351351
}
352352

353353
delete this._observerSubscription;
354+
this.hooks?.onInfiniteQueryDestroy?.(this);
354355
};
355356

356357
destroy() {
357358
this.abortController.abort();
358-
this.hooks?.onInfiniteQueryDestroy?.(this);
359359
}
360360

361361
/**

src/mobx-mutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ export class MobxMutation<
149149
}
150150

151151
delete this._observerSubscription;
152+
this.hooks?.onMutationDestroy?.(this);
152153
};
153154

154155
destroy() {
155156
this.abortController.abort();
156-
this.hooks?.onMutationDestroy?.(this);
157157
}
158158

159159
/**

src/mobx-query.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ export class MobxQuery<
305305
}
306306

307307
delete this._observerSubscription;
308+
309+
this.hooks?.onQueryDestroy?.(this);
308310
};
309311

310312
destroy() {
311313
this.abortController.abort();
312-
this.hooks?.onQueryDestroy?.(this);
313314
}
314315

315316
/**

0 commit comments

Comments
 (0)