jotaijs / jotai-urql

Jotai integration library for URQL
MIT License
29 stars 5 forks source link

Async Variables #16

Open jeanfortheweb opened 1 year ago

jeanfortheweb commented 1 year ago

Hello guys,

one of the latest jotai updates made all eventually async operations inside of atoms also async. Therefore, my variables for my query became async too. Any plans to support this? As far as i can see, at the moment of writing, my variables atom can only be sync.

Thanks!

dai-shi commented 1 year ago

In jotai-tanstack-query, we had a long discussion in https://github.com/jotaijs/jotai-tanstack-query/issues/21 and came up with https://github.com/jotaijs/jotai-tanstack-query/pull/30. I think we should follow the same approach in jotai-urql.

jeanfortheweb commented 1 year ago

Same here again, thanks for the fast reply! unwrap seems to work just fine for me here, i also use getPause to see if i was able to unwrap a value.

QWu4xYV commented 8 months ago

I was also able to use unwrap+getPause to resolve this for now, but some kind of built-in solution would be slightly more elegant. Can we re-open this? I don't have bandwidth to work on it right now, but maybe in the future