* docs(query-keys): clarify query key refetching
Update the query-key documentation to note that changing data included in a query key will automatically refetch the query data.
It took me a long time to find this information, and I expected to find it here. I consulted with another engineer on our team, and they agreed that they would expect to see it stated more clearly here. So we felt this addition would be helpful.
* Update docs/react/guides/query-keys.md
* Update docs/react/guides/query-keys.md
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
This is only relevant when a custom online / focus boolean has been set; in those cases, we previously only informed listeners if the value was truthy, but not if it changed back to false or undefined again
With this fix, the managers inform the listeners whenever something has changed, regardless of which direction the change was
* [Fix-5538]: Assign observer's current Result when an optimistic reading occurs
* move the condition outside so would make making decision about v4 and v5 easier & remove fake timers
* Flip test on currentResult with placeholderData's order & add test for placeholderData
* Fix tests using the same queryKey
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
Although QueryFunctionContext allows setting the pageParam type
through generics, QueryFunction uses QueryFunctionContext without
exposing this typing functionality. This forces any queryFn
typed as a QueryFunction to have an `any` pageParam. This change adds
TPageParam to QueryFunction type, which is passed through to
QueryFunctionContext.
This should be backward compatible and only affects typing (not runtime code).
Co-authored-by: Mike Lyons <mike@dropbox.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
* refactor(rect-query): prefer client-only import over 'use client'
for things that cannot work on the server, like the QueryClientProvider or the hooks; this will give better error message when attempted to be used in a server component
* chore: update rollup-plugin-preserve-directives to 0.2.0
* Update useAppState.ts
Updating the cleanup function as the removeEventLister method is not available on AppState
* Update useAppState.ts
Removed Semicolons
---------
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>