-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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(types): v2 #626
fix(types): v2 #626
Conversation
Since you're already working on this - |
How's it going over here? |
only |
i think this has everything except |
I wanted to do the @@ -612,7 +578,8 @@ export interface QueryCache {
| undefined
| (() => TKey | false | null | undefined),
queryFn: QueryFunction<TResult, TKey>,
- config?: PrefetchQueryOptions<TResult, TError>
+ config?: QueryOptions<TResult, TError>,
+ options?: PrefetchQueryOptions<TResult, TError>,
): Promise<TResult>
prefetchQuery<TResult, TKey extends string, TError = Error>(
@@ -623,7 +590,8 @@ export interface QueryCache {
| undefined
| (() => TKey | false | null | undefined),
queryFn: QueryFunction<TResult, [TKey]>,
- config?: PrefetchQueryOptions<TResult, TError>
+ config?: QueryOptions<TResult, TError>,
+ options?: PrefetchQueryOptions<TResult, TError>
): Promise<TResult>
prefetchQuery<TResult, TKey extends AnyQueryKey, TError = Error>(
@@ -634,7 +602,8 @@ export interface QueryCache {
| undefined
| (() => TKey | false | null | undefined),
queryFn: QueryFunction<TResult, TKey>,
- config?: PrefetchQueryOptions<TResult, TError>
+ config?: QueryOptions<TResult, TError>,
+ options?: PrefetchQueryOptions<TResult, TError>
): Promise<TResult>
prefetchQuery<TResult, TKey extends string, TError = Error>(
@@ -645,12 +614,12 @@ export interface QueryCache {
| undefined
| (() => TKey | false | null | undefined),
queryFn: QueryFunction<TResult, [TKey]>,
- config?: PrefetchQueryOptions<TResult, TError>
+ config?: QueryOptions<TResult, TError>,
+ options?: PrefetchQueryOptions<TResult, TError>
): Promise<TResult>
prefetchQuery<TResult, TKey extends AnyQueryKey, TError = Error>({
queryKey,
-
queryFn,
config,
}: {
@@ -661,7 +630,8 @@ export interface QueryCache {
| undefined
| (() => TKey | false | null | undefined)
queryFn: QueryFunction<TResult, TKey>
- config?: PrefetchQueryOptions<TResult, TError>
+ config?: QueryOptions<TResult, TError>,
+ options?: PrefetchQueryOptions<TResult, TError>
}): Promise<TResult> Edit: the diff was in the wrong direction |
I'll open other PR for it, feel free to include it in this one if you'd prefer to keep it under one roof |
the types for prefetch are in another pr |
You guys could try and use the new github code suggestions for those prefetch types? https://github.blog/2018-10-16-future-of-software/#suggested-changes-public-beta |
To do so in this PR we'd need some change in somewhere near those lines of code as it doesn't seem to be possible to add comments/suggestions outside of a narrow context of the changed lines. |
Darn! |
@kizivat You can also open a PR against |
😬 maaaaybe? |
So doesn't the |
i think i misremembered that, it doesnt look like it is optional |
wellp, it is optional,and defaults to config.queryFn |
Is there anything anyone is waiting on me for? |
ok, dtslint passes |
Cool , you should be able to add dtslint to the test:ci script in the package.json |
Fantastic! |
i wasnt sure about |
I think I’d still viable. The variables it is referring to are not the optional variables that were deprecated. I think. 😂 |
could you explain a bit? i dont understand what this test is testing. |
You're right. Useless. Get it out of there! ;) |
Is this missing a resetErrorBoundaries definition on QueryCache? |
This is looking great. Do you all think these are good enough to release in their current state? Then we can just continue to improve and fix them as we go? |
LGTM |
Wow, thanks everyone here for working on this. I appreciate you. If you played any part in these great types, please feel free to open an issue and tag yourself using the all-contributors bot to add yourself to the contributor list. |
🎉 This PR is included in version 2.4.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Congrats on shipping type definitions! I know first hand it is no easy task to author definitions for a JS project 😄 great work! |
Nice work all! |
Fantastic work - thanks for putting in the effort! |
Thanks for the work, everyone. Definitely looking forward to testing out the new types |
Many thanks for your work folks! 🎉 I was pretty impatient to try v2 with typings and installed 2.4.4 the first thing this morning 😅 All fits well in the tests project except one small thing in tests: afterEach(() => {
queryCache.clear({ notify: false }) // Expected 0 arguments, but got 1.ts(2554)
}) I can imagine a few more small hickups here and there, so wondering what’s the best place to track them. Does every possible error deserves its own PR or should we try collecting a few reports first and mitigate them as a batch? |
@kachkaev I think you can just create a PR to fix that typing issue and we can fix them all when we come across them. |
working on updating types for v2