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

fix(query): prevent creating QueryObserver multiple times #1313

Merged
merged 19 commits into from
Aug 1, 2022

Conversation

Aslemammad
Copy link
Member

@Aslemammad Aslemammad commented Jul 27, 2022

Resolves: #957

This issue tries to track the query options through queryObserver.setOptions, so @tanstack/query-core features like keepPreviousData work properly!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@vercel
Copy link

vercel bot commented Jul 27, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
jotai ✅ Ready (Inspect) Visit Preview Sep 1, 2022 at 4:35AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jul 27, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a82d905:

Sandbox Source
React Configuration
React Typescript Configuration
React Browserify Configuration
React Snowpack Configuration
Next.js Configuration
Next.js with custom Babel config Configuration
React with custom Babel config Configuration
atomWithQuery + keepPreviousData Issue #957

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Should be good to go.

Comment on lines -94 to -97
type State = {
isMounted: boolean
unsubscribe: (() => void) | null
}
Copy link
Member

Choose a reason for hiding this comment

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

Good that I was able to remove this. Didn't like this.

Copy link
Member Author

@Aslemammad Aslemammad left a comment

Choose a reason for hiding this comment

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

LGTM!

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.

Prevent suspending atomWithQuery when keepPreviousData is true
2 participants