mobx-tanstack-query-api 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-tanstack-query-api",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "js2me",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"@types/lodash": "^4.17.16",
|
|
24
24
|
"@types/lodash-es": "^4.17.12",
|
|
25
25
|
"http-status-code-types": "^0.0.2",
|
|
26
|
-
"mobx-tanstack-query": "^6.2.
|
|
26
|
+
"mobx-tanstack-query": "^6.2.2",
|
|
27
27
|
"swagger-typescript-api": "13.2.7",
|
|
28
28
|
"ts-morph": "^26.0.0",
|
|
29
29
|
"undici-types": "^7.11.0",
|
|
30
|
-
"yummies": "^4.
|
|
30
|
+
"yummies": "^4.12.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^20.17.11",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint-query.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint-query.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoint-query.d.ts","sourceRoot":"","sources":["../../src/runtime/endpoint-query.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAAE,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAC;AAG3E,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAW,MAAM,qBAAqB,CA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,MAAM,oBAAoB,GAAI,KAAK,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,KAChC,WAAW,CAAC,UAAU,CAC7D,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,UAAU,WAAW,EACrB,QAAQ,UAAU,CAAC,SAAS,CAAC,EAC7B,SAAS,KAAK,CAAC,oBAAoB,CAAC,KACnC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,GAAG,EAAE,CAAA;CAerC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { comparer, computed, makeObservable, observable,
|
|
1
|
+
import { comparer, computed, makeObservable, observable, reaction, runInAction, } from 'mobx';
|
|
2
2
|
import { Query } from 'mobx-tanstack-query';
|
|
3
3
|
import { callFunction } from 'yummies/common';
|
|
4
|
+
import { getMobxAdministration, lazyObserve } from 'yummies/mobx';
|
|
4
5
|
export class EndpointQuery extends Query {
|
|
5
6
|
endpoint;
|
|
6
7
|
uniqKey;
|
|
@@ -76,8 +77,7 @@ export class EndpointQuery extends Query {
|
|
|
76
77
|
},
|
|
77
78
|
});
|
|
78
79
|
this.endpoint = endpoint;
|
|
79
|
-
|
|
80
|
-
const parentAtom = this[$mobx];
|
|
80
|
+
const parentAtom = getMobxAdministration(this);
|
|
81
81
|
computed.struct(this, 'params');
|
|
82
82
|
computed.struct(this, 'response');
|
|
83
83
|
makeObservable(this);
|
|
@@ -119,17 +119,10 @@ export class EndpointQuery extends Query {
|
|
|
119
119
|
fireImmediately: true,
|
|
120
120
|
});
|
|
121
121
|
if (this.isLazy) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
onBecomeUnobserved(parentAtom.values_.get('_result'), () => {
|
|
129
|
-
if (disposeFn) {
|
|
130
|
-
disposeFn();
|
|
131
|
-
disposeFn = undefined;
|
|
132
|
-
}
|
|
122
|
+
lazyObserve({
|
|
123
|
+
property: parentAtom.values_.get('_result'),
|
|
124
|
+
onStart: createParamsReaction,
|
|
125
|
+
onEnd: (disposeFn) => disposeFn(),
|
|
133
126
|
});
|
|
134
127
|
}
|
|
135
128
|
else {
|