-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Describe the bug
In the documentation for svelte-query v5, it is suggested that you can provide stores for queryOptions in order to make reactive queries: https://tanstack.com/query/v5/docs/svelte/reactivity
This works great with writable stores, as seen in this simple example: https://svelte.dev/repl/7d299dce4d9a4b6ba590d6707f383d62?version=4.0.2
However, it does not work with a derived store, as seen in this example:
https://svelte.dev/repl/ee90c13684af4672a19661e9e9021da3?version=4.0.2
The derived store options appear to be completely ignored; no fetching happens.
Your minimal, reproducible example
Steps to reproduce
Try changing the input box to a different number. Observe that the query never fetches. Also observe in the console that the updated options store value is produced as expected.
Expected behavior
A user should be able to provide a derived store as query options and it should work the same as if a writable store is provided: the query should react to the latest value of the store for its options.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
OSX Chrome
Tanstack Query adapter
svelte-query
TanStack Query version
v5.0.0-alpha.7
TypeScript version
No response
Additional context
No response