Skip to content
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

Create atomWithObservable only once #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scamden
Copy link

@scamden scamden commented May 17, 2024

This is in response to a few issues we've had and was suggested as a possible solution in #17

I'm trying it in our code base via a published version of our fork and thought I would put it up for dicussion here.

@@ -25,6 +25,12 @@ export function atomWithQuery<
(context, get) => {
const pause = getPause(get)
const client = getClient(get)

if (pause) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops will remove

@dai-shi dai-shi requested a review from RIP21 May 17, 2024 22:39
@RIP21
Copy link
Collaborator

RIP21 commented May 17, 2024

I haven't touched this codebase for some time plus my Jotai skills are a bit rusty (not using it for quite some time). But if it works and passes all the test cases we have. Then it's good for me.
If you have some special test scenarios not covered with our test suite, please add the test cases, so we can keep everything 100% tested no matter the corner case.

Once it's done then I'll approve this and publish new version. Looking at your comment in the issue, I see that you're much deeper in the rabbit hole than I will ever be with Jotai ever again :D (I'm not a fan anymore) So if you will fix it and test it, well, kudos to you :D

@scamden scamden force-pushed the sterling-fix-in-read-atom-creation branch 2 times, most recently from 21061b8 to b9412b9 Compare May 18, 2024 00:53
@scamden scamden force-pushed the sterling-fix-in-read-atom-creation branch from b9412b9 to 4e6b8b2 Compare May 18, 2024 01:00
@jtcomp
Copy link

jtcomp commented Jun 10, 2024

⬆️ On this fix - I had to patch the most recent version of jotai-urql because I was running into the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants