Skip to content

Commit

Permalink
Move promise inline
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Dec 8, 2022
1 parent 9cff58d commit 37ec144
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/react/hooks/useSuspenseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ export function useSuspenseQuery_experimental<
if (variables !== previousOpts.variables || query !== previousOpts.query) {
suspenseCache.remove(previousOpts.query, previousOpts.variables);

const promise = observable.reobserve({ query, variables });
suspenseCache.add(query, variables, {
promise: observable.reobserve({ query, variables }),
observable,
});

suspenseCache.add(query, variables, { promise, observable });
previousWatchQueryOptionsRef.current = watchQueryOptions;
}
}, [watchQueryOptions]);
Expand Down

0 comments on commit 37ec144

Please sign in to comment.