Skip to content

Having trouble re-executing a query (Svelte) #1415

Answered by kitten
a-human-bean asked this question in Q&A
Discussion options

You must be logged in to vote

Alright, just to get started. It would have been a little quicker not to start the thread with pausing, since you've written that that works and it very closely matches the docs 😅 anyway;

I suppose, your first question is why the operation doesn't execute again when you reassign something. The answer is why would it? As long as nothing actually changes there's no need to rerun anything.

In fact; you already understood that the request policy needs to change so that the cache is skipped.

The solution here is that it seems that you want to run the query conditionally. On the one hand, I know that Svelte would support wrapping the query(opStore) line reactively. However, it may be much easie…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@a-human-bean
Comment options

@kitten
Comment options

Answer selected by a-human-bean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants