@tramvai/react-query 2.59.3 → 2.59.4

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  import identity from '@tinkoff/utils/function/identity';
2
- import { Container, DI_TOKEN } from '@tinkoff/dippy';
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
- return diOrContext instanceof Container
28
- ? diOrContext
29
- : diOrContext.di;
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
- return diOrContext instanceof dippy.Container
36
- ? diOrContext
37
- : diOrContext.di;
38
+ if (isActionContext(diOrContext)) {
39
+ return diOrContext.di;
40
+ }
41
+ return diOrContext;
38
42
  };
39
43
 
40
44
  const convertToRawQuery$1 = (query, di, options) => {
@@ -1,3 +1,3 @@
1
- import { Container } from '@tinkoff/dippy';
1
+ import type { Container } from '@tinkoff/dippy';
2
2
  import type { ActionContext } from '@tramvai/core';
3
3
  export declare const resolveDI: (diOrContext: ActionContext | Container) => Container;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/react-query",
3
- "version": "2.59.3",
3
+ "version": "2.59.4",
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.59.3",
23
- "@tramvai/module-react-query": "2.59.3",
24
- "@tramvai/react": "2.59.3",
25
- "@tramvai/tokens-common": "2.59.3"
22
+ "@tramvai/core": "2.59.4",
23
+ "@tramvai/module-react-query": "2.59.4",
24
+ "@tramvai/react": "2.59.4",
25
+ "@tramvai/tokens-common": "2.59.4"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@tinkoff/dippy": "0.8.11",