-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: atomsWithQueryAsync, plus example #30
Conversation
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 9bb7892:
|
Thanks for working on it. Can you please try adding some tests? You don't need to follow the patterns of existing tests. |
src/atomsWithQueryAsync.ts
Outdated
@@ -0,0 +1,56 @@ | |||
import type { QueryKey, QueryObserverOptions } from '@tanstack/query-core' | |||
import type { ExtractAtomValue, Getter, WritableAtom } from 'jotai' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With pmndrs/jotai#1741, we should be able to use it.
import type { ExtractAtomValue, Getter, WritableAtom } from 'jotai' | |
import type { ExtractAtomArgs, ExtractAtomValue, Getter, WritableAtom } from 'jotai' |
Hi @dai-shi , I have a couple of doubts. First, I tried to add a test for the Second, when we fire the |
Not sure. Is it only about tests? It works in codesandbox, right?
Oh, I didn't realized that. Does it work with atomsWithQuery? Not sure if we can fix it. Maybe for now we reject using |
I was able to fix the tests, and
|
Nice.
Fine. Do you want to disable the force option in atomsWithQueryAsync? Please check CI results. Seems like trivial linting issue. |
I'd rather not to disable it, so I worked on a fix. I updated the sandbox: https://codesandbox.io/s/hopeful-silence-f2zs2k?file=/src/App.tsx |
Fix to #21