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>
This commit replaces the use of `.indexOf` with `.includes` for cases
where the method is used to check if an array contains a particular
element. This results in improved code readability and better adherence
to modern JavaScript best practices.
The replaced code snippets include:
- `.indexOf(...) === -1`
- `.indexOf(...) !== -1`
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>