@tramvai/react-query 2.59.3 → 2.61.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/lib/index.es.js +8 -4
- package/lib/index.js +7 -3
- package/lib/shared/resolveDI.d.ts +1 -1
- package/package.json +5 -5
package/lib/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import identity from '@tinkoff/utils/function/identity';
|
|
2
|
-
import {
|
|
2
|
+
import { DI_TOKEN } from '@tinkoff/dippy';
|
|
3
3
|
import { declareAction } from '@tramvai/core';
|
|
4
4
|
import { QUERY_CLIENT_TOKEN } from '@tramvai/module-react-query';
|
|
5
5
|
import { CONTEXT_TOKEN } from '@tramvai/tokens-common';
|
|
@@ -22,11 +22,15 @@ const normalizeKey = (key) => {
|
|
|
22
22
|
return [key];
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
const isActionContext = (diOrContext) => {
|
|
26
|
+
return 'di' in diOrContext;
|
|
27
|
+
};
|
|
25
28
|
// @TODO: v3: leave only di container in next major
|
|
26
29
|
const resolveDI = (diOrContext) => {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
if (isActionContext(diOrContext)) {
|
|
31
|
+
return diOrContext.di;
|
|
32
|
+
}
|
|
33
|
+
return diOrContext;
|
|
30
34
|
};
|
|
31
35
|
|
|
32
36
|
const convertToRawQuery$1 = (query, di, options) => {
|
package/lib/index.js
CHANGED
|
@@ -30,11 +30,15 @@ const normalizeKey = (key) => {
|
|
|
30
30
|
return [key];
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const isActionContext = (diOrContext) => {
|
|
34
|
+
return 'di' in diOrContext;
|
|
35
|
+
};
|
|
33
36
|
// @TODO: v3: leave only di container in next major
|
|
34
37
|
const resolveDI = (diOrContext) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
if (isActionContext(diOrContext)) {
|
|
39
|
+
return diOrContext.di;
|
|
40
|
+
}
|
|
41
|
+
return diOrContext;
|
|
38
42
|
};
|
|
39
43
|
|
|
40
44
|
const convertToRawQuery$1 = (query, di, options) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/react-query",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.61.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@tinkoff/react-hooks": "0.1.4",
|
|
22
|
-
"@tramvai/core": "2.
|
|
23
|
-
"@tramvai/module-react-query": "2.
|
|
24
|
-
"@tramvai/react": "2.
|
|
25
|
-
"@tramvai/tokens-common": "2.
|
|
22
|
+
"@tramvai/core": "2.61.1",
|
|
23
|
+
"@tramvai/module-react-query": "2.61.1",
|
|
24
|
+
"@tramvai/react": "2.61.1",
|
|
25
|
+
"@tramvai/tokens-common": "2.61.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@tinkoff/dippy": "0.8.11",
|