Skip to content

Commit

Permalink
Update operators.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacherl authored Mar 4, 2024
1 parent 93631c1 commit 6aaf946
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions query/src/lib/operators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<R> & { all: T };

if (mappedResult.isSuccess) {
Expand Down

0 comments on commit 6aaf946

Please sign in to comment.