From 6aaf946407fcbec9742f8946f01aad9aebc4d408 Mon Sep 17 00:00:00 2001 From: Zacherl Date: Mon, 4 Mar 2024 13:37:21 +0100 Subject: [PATCH] Update operators.ts --- query/src/lib/operators.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/query/src/lib/operators.ts b/query/src/lib/operators.ts index 72ba9bb..d4af75e 100644 --- a/query/src/lib/operators.ts +++ b/query/src/lib/operators.ts @@ -148,6 +148,7 @@ export function intersectResults$< return map((values) => { const isArray = Array.isArray(values); const toArray = isArray ? values : Object.values(values); + const refetch = () => Promise.all(toArray.map(v => v.refetch())); const mappedResult = { all: values, @@ -158,6 +159,7 @@ export function intersectResults$< isFetching: toArray.some((v) => v.isFetching), error: toArray.find((v) => v.isError)?.error, data: undefined, + refetch, } as unknown as QueryObserverResult & { all: T }; if (mappedResult.isSuccess) {