@refinedev/core 4.44.3 → 4.44.5
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/CHANGELOG.md +104 -0
- package/dist/contexts/live/ILiveContext.d.ts +9 -0
- package/dist/contexts/live/ILiveContext.d.ts.map +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/data/useCreate.d.ts +1 -1
- package/dist/hooks/data/useCreate.d.ts.map +1 -1
- package/dist/hooks/data/useCreateMany.d.ts +1 -1
- package/dist/hooks/data/useCreateMany.d.ts.map +1 -1
- package/dist/hooks/data/useDelete.d.ts +2 -2
- package/dist/hooks/data/useDelete.d.ts.map +1 -1
- package/dist/hooks/data/useDeleteMany.d.ts +2 -2
- package/dist/hooks/data/useDeleteMany.d.ts.map +1 -1
- package/dist/hooks/data/useInfiniteList.d.ts +2 -2
- package/dist/hooks/data/useInfiniteList.d.ts.map +1 -1
- package/dist/hooks/data/useList.d.ts +1 -1
- package/dist/hooks/data/useList.d.ts.map +1 -1
- package/dist/hooks/data/useMany.d.ts +1 -1
- package/dist/hooks/data/useMany.d.ts.map +1 -1
- package/dist/hooks/data/useOne.d.ts +1 -1
- package/dist/hooks/data/useOne.d.ts.map +1 -1
- package/dist/hooks/data/useUpdate.d.ts +1 -1
- package/dist/hooks/data/useUpdate.d.ts.map +1 -1
- package/dist/hooks/data/useUpdateMany.d.ts +1 -1
- package/dist/hooks/data/useUpdateMany.d.ts.map +1 -1
- package/dist/hooks/live/useResourceSubscription/index.d.ts +10 -1
- package/dist/hooks/live/useResourceSubscription/index.d.ts.map +1 -1
- package/dist/hooks/live/useSubscription/index.d.ts +8 -3
- package/dist/hooks/live/useSubscription/index.d.ts.map +1 -1
- package/dist/iife/index.js +5 -5
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces/live/LiveEvent.d.ts +4 -1
- package/dist/interfaces/live/LiveEvent.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/contexts/live/ILiveContext.ts +7 -0
- package/src/hooks/data/useCreate.ts +45 -41
- package/src/hooks/data/useCreateMany.ts +41 -38
- package/src/hooks/data/useDelete.ts +48 -40
- package/src/hooks/data/useDeleteMany.ts +52 -43
- package/src/hooks/data/useInfiniteList.ts +30 -27
- package/src/hooks/data/useList.ts +26 -23
- package/src/hooks/data/useMany.ts +23 -20
- package/src/hooks/data/useOne.ts +23 -20
- package/src/hooks/data/useUpdate.ts +52 -39
- package/src/hooks/data/useUpdateMany.ts +48 -40
- package/src/hooks/live/useResourceSubscription/index.ts +23 -6
- package/src/hooks/live/useSubscription/index.ts +10 -2
- package/src/interfaces/live/LiveEvent.ts +4 -1
|
@@ -33,6 +33,9 @@ export type UseSubscriptionProps = {
|
|
|
33
33
|
params?: {
|
|
34
34
|
ids?: BaseKey[];
|
|
35
35
|
id?: BaseKey;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated `params.meta` is depcerated. Use `meta` directly from the root level instead.
|
|
38
|
+
*/
|
|
36
39
|
meta?: MetaQuery;
|
|
37
40
|
/**
|
|
38
41
|
* @deprecated `metaData` is deprecated with refine@4, refine will pass `meta` instead, however, we still support `metaData` for backward compatibility.
|
|
@@ -54,10 +57,10 @@ export type UseSubscriptionProps = {
|
|
|
54
57
|
[key: string]: any;
|
|
55
58
|
};
|
|
56
59
|
/**
|
|
57
|
-
*
|
|
58
|
-
* @default "default"
|
|
60
|
+
* @deprecated use `meta.dataProviderName` instead.
|
|
59
61
|
*/
|
|
60
62
|
dataProviderName?: string;
|
|
63
|
+
meta?: MetaQuery & { dataProviderName?: string };
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
export const useSubscription = ({
|
|
@@ -67,6 +70,7 @@ export const useSubscription = ({
|
|
|
67
70
|
enabled = true,
|
|
68
71
|
onLiveEvent,
|
|
69
72
|
dataProviderName = "default",
|
|
73
|
+
meta,
|
|
70
74
|
}: UseSubscriptionProps): void => {
|
|
71
75
|
const liveDataContext = useContext<ILiveContext>(LiveContext);
|
|
72
76
|
|
|
@@ -80,6 +84,10 @@ export const useSubscription = ({
|
|
|
80
84
|
types,
|
|
81
85
|
callback: onLiveEvent,
|
|
82
86
|
dataProviderName,
|
|
87
|
+
meta: {
|
|
88
|
+
...meta,
|
|
89
|
+
dataProviderName,
|
|
90
|
+
},
|
|
83
91
|
});
|
|
84
92
|
}
|
|
85
93
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseKey } from "..";
|
|
1
|
+
import { BaseKey, MetaQuery } from "..";
|
|
2
2
|
|
|
3
3
|
export type LiveEvent = {
|
|
4
4
|
channel: string;
|
|
@@ -8,4 +8,7 @@ export type LiveEvent = {
|
|
|
8
8
|
[x: string]: any;
|
|
9
9
|
};
|
|
10
10
|
date: Date;
|
|
11
|
+
meta?: MetaQuery & {
|
|
12
|
+
dataProviderName?: string;
|
|
13
|
+
};
|
|
11
14
|
};
|