-
Notifications
You must be signed in to change notification settings - Fork 31
feat(queries): add setEnabled function to queries and infinite queries #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Thanks :) |
Hmmm... I'm not sure that all options need this reactivity. Maybe a good way to handle all other cases would be to add a function named eg: function mergeOptions(options: UseQueryOptions<TQueryFnData, TError, TData>): void {
observer.setOptions({ ...observer.options, ...options })
} What do you think? |
Yes, cool... it seems ok for me 👍 |
Do you have a preference on naming? |
maybe updateOptions :) |
Hi @amen-souissi, I added the Is there something missing before merging? |
I'm so sorry I haven't seen the changes :( ... merged and released 👍 |
There is absolutely no problem 😁 ! Thank you for merging and releasing this, I will update my stack. |
Can this apply to, useQueries, as well? |
In some situations, we need to enable or disable queries using svelte reactive statements.
We can do this using the
setOptions
method but it forces us to pass all options.It could be very useful to have a
setEnabled
shortcut function which reuse existing options and only update theenabled
option.It allows this code:
to become
It makes the code more readable and understandable.
Do you agree?