Skip to content

Conversation

@cherniavskii
Copy link
Contributor

Currently there's refetchAllOnWindowFocus provider option, which allows to control refetching on window focus for all queries.

This PR adds refetchOnWindowFocus option to useQuery, which allows to control refetching on window focus on per-query basis.

@size-plugin
Copy link
Contributor

size-plugin bot commented Dec 9, 2019

Size report for the changes in this PR:

sizes-cjs Overall size: 6.59 kB

 index.js ⏤  6.59 kB (+54 B)

sizes-es Overall size: 6.46 kB

 index.es.js ⏤  6.46 kB (+54 B)

commit: b3d352b

like it?

⭐️ me 😊

@tannerlinsley
Copy link
Member

Looks good!

@tannerlinsley tannerlinsley merged commit ffcbbb5 into TanStack:master Dec 9, 2019
@cherniavskii cherniavskii deleted the refetchOnWindowFocus branch December 9, 2019 21:06
@milahu
Copy link

milahu commented Oct 23, 2022

im surprised that this option

  • is default true
  • overrides cacheTime: Infinity

@TkDodo
Copy link
Collaborator

TkDodo commented Oct 23, 2022

@milahu it does default to true, yes, which means it respects staleTime.

overrides cacheTime: Infinity

no idea what this means, sorry. cacheTime is a completely unrelated property...

@nx-cloud
Copy link

nx-cloud bot commented Jan 7, 2025

View your CI Pipeline Execution ↗ for commit b3d352b

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded <1s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2025-09-26 15:57:55 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants