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

add atomWithQuery.ts #43

Closed
wants to merge 1 commit into from
Closed

add atomWithQuery.ts #43

wants to merge 1 commit into from

Conversation

kalijonn
Copy link
Collaborator

The intention of this PR is for feedback and to guage if this is what is meant by 'overhaul'

I was looking at #42 . I looked at jotai-urql and it looks the the overhaul is to keep the api the same as what urql does?

urql's useQuery returns [data, reexecuteQuery] and so does jotai-urql.

If that's the intention, is this PR inline with what you have in mind for jotai-tanstack-query?

I haven't added things like observerCacheAtom because I haven't fully gone through these patterns. Just wanted to get thoughts on the direction before putting more effort.

@codesandbox-ci
Copy link

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 a670cd3:

Sandbox Source
React Configuration
React TypeScript Configuration

get: Getter
) => QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>,
getQueryClient: (get: Getter) => QueryClient = (get) => get(queryClientAtom)
) {
Copy link
Member

Choose a reason for hiding this comment

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

What would be the return type? Can you explicitly type it? (For now, I don't care the impl below.)

@dai-shi
Copy link
Member

dai-shi commented Sep 15, 2023

Thanks for working on it.
I think eventually we would need to write tests to define the behavior. Test first would be nice for this overhaul.

@kalijonn
Copy link
Collaborator Author

I've looked at this a lot more the last couple of days to understand the current implementation. Also looked at jotai-urql to understand the overhaul. I think that's going to be a good frame of reference to understand the motivation and possibly how to achieve it.

So far what I got is, we want to keep the api same as @tanstack/react-query. We want to leverage @tanstack/query-core to expose functionality rather than implementing it. Let me know if I'm missing the point.

I'll be looking at this in the next week. Will reach out in the discord if necessary.

@kalijonn kalijonn closed this Sep 17, 2023
@dai-shi
Copy link
Member

dai-shi commented Sep 18, 2023

Looking forward to it.

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.

2 participants