Replies: 5 comments
-
Persisted Query section? |
Beta Was this translation helpful? Give feedback.
-
I think it's different. In this example https://github.com/ngneat/query/blob/main/packages/playground/src/app/pagination-page/pagination-page.component.ts you should subscribe on observable and pass it's value to persisted query, right? But I'm talking about the fact that we do not need to subscribe, let the library do it for you. It should be easier: // transform this
page$.pipe(switchMap(page => useQuery(['page',page])))
// into this
useQuery(['page',page$]) |
Beta Was this translation helpful? Give feedback.
-
@NetanelBasal Just out of curiosity, do you think this would be possible now? I think with if we used signals, or transform all option keys to a signal and use a more sophisticated |
Beta Was this translation helpful? Give feedback.
-
Do we really need it? Calling the exposed setOptions should be enough, no? |
Beta Was this translation helpful? Give feedback.
-
@luii I've added an updateOptions in next branch. You can test it if you have a real use case. I don't use it in my application. |
Beta Was this translation helpful? Give feedback.
-
Which @ngneat/query-* package(s) are relevant/releated to the feature request?
No response
Description
If you use Tanstack Query in React world (
useQuery(['posts', id], ()=>{})
), state keys are being recalculated everyid
change together with data refetch.@ngneat/query does not support this reactive recalculation. We should get new query for every new
id
:To provide reactive functionality,
useQuery
function should consume object with observable values and automatically refetch data on observable changes:Then inside component:
Proposed solution
Add way to pass observable as state key and get them inside http query.
Alternatives considered
https://github.com/liaoliao666/react-query-kit
Do you want to create a pull request?
No
Beta Was this translation helpful? Give feedback.
All reactions