No promises with Svelte's queryStore or mutationStore? #3572
Unanswered
arthur5005
asked this question in
Q&A
Replies: 1 comment 1 reply
-
There's some issues and discussions around this asking the same question Essentially, what you want to do is use the client directly if you need an imperative call, e.g. Keep in mind please that if you do In your case though, it sounds like you're just issuing a mutation imperatively. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been playing around with urql's bindings for svelte, and while I appreciate the use of stores for derived state, I'm surprised there's no way to use them and get a promise for a given query/mutation.
All I'm looking to do is call an event on my component when the query/mutation completes (in my case, emit an event to close a modal after you've saved the details).
I can subscribe to the store on state changes, but it feels like a leaky abstraction, having to subscribe store construction, unsubscribe on component destruction, etc.
Am I missing something or is this an area for improvement?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions