@xen-orchestra/web-core 0.35.0 → 0.35.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.
|
@@ -135,9 +135,9 @@ export function defineRemoteResource<
|
|
|
135
135
|
|
|
136
136
|
const onDataReceived =
|
|
137
137
|
config.onDataReceived ??
|
|
138
|
-
((data: Ref<TData>, receivedData: any,
|
|
138
|
+
((data: Ref<TData>, receivedData: any, context?: ResourceContext<TArgs>) => {
|
|
139
139
|
// allow to ignore some update (like for sub collection. E.g. vms/:id/vdis)
|
|
140
|
-
if (config.watchCollection?.predicate?.(receivedData,
|
|
140
|
+
if (config.watchCollection?.predicate?.(receivedData, context) === false) {
|
|
141
141
|
return
|
|
142
142
|
}
|
|
143
143
|
if (data.value === undefined || (Array.isArray(data.value) && Array.isArray(receivedData))) {
|
|
@@ -156,9 +156,9 @@ export function defineRemoteResource<
|
|
|
156
156
|
|
|
157
157
|
const onDataRemoved =
|
|
158
158
|
config.onDataRemoved ??
|
|
159
|
-
((data: Ref<TData>, receivedData: any,
|
|
159
|
+
((data: Ref<TData>, receivedData: any, context?: ResourceContext<TArgs>) => {
|
|
160
160
|
// allow to ignore some update (like for sub collection. E.g. vms/:id/vdis)
|
|
161
|
-
if (
|
|
161
|
+
if (config.watchCollection?.predicate?.(receivedData, context) === false) {
|
|
162
162
|
return
|
|
163
163
|
}
|
|
164
164
|
|