File tree Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Expand file tree Collapse file tree 3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ export class MobxInfiniteQuery<
3636 TError = DefaultError ,
3737 TQueryKey extends QueryKey = any ,
3838 TPageParam = unknown ,
39- > {
39+ > implements Disposable
40+ {
4041 protected abortController : AbortController ;
4142 protected queryClient : QueryClient | MobxQueryClient ;
4243
@@ -348,4 +349,8 @@ export class MobxInfiniteQuery<
348349 dispose ( ) {
349350 this . destroy ( ) ;
350351 }
352+
353+ [ Symbol . dispose ] ( ) : void {
354+ this . destroy ( ) ;
355+ }
351356}
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ export class MobxMutation<
1717 TVariables = void ,
1818 TError = DefaultError ,
1919 TContext = unknown ,
20- > {
20+ > implements Disposable
21+ {
2122 protected abortController : AbortController ;
2223 protected queryClient : QueryClient | MobxQueryClient ;
2324
@@ -143,7 +144,18 @@ export class MobxMutation<
143144 delete this . _observerSubscription ;
144145 } ;
145146
146- dispose ( ) {
147+ destroy ( ) {
147148 this . abortController . abort ( ) ;
148149 }
150+
151+ /**
152+ * @deprecated use `destroy`
153+ */
154+ dispose ( ) {
155+ this . destroy ( ) ;
156+ }
157+
158+ [ Symbol . dispose ] ( ) : void {
159+ this . destroy ( ) ;
160+ }
149161}
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ export class MobxQuery<
3232 TData ,
3333 TError = DefaultError ,
3434 TQueryKey extends QueryKey = any ,
35- > {
35+ > implements Disposable
36+ {
3637 protected abortController : AbortController ;
3738 protected queryClient : QueryClient | MobxQueryClient ;
3839
@@ -308,4 +309,8 @@ export class MobxQuery<
308309 dispose ( ) {
309310 this . destroy ( ) ;
310311 }
312+
313+ [ Symbol . dispose ] ( ) : void {
314+ this . destroy ( ) ;
315+ }
311316}
You can’t perform that action at this time.
0 commit comments