feat: add PageParam typing#5005
Merged
TkDodo merged 6 commits intoTanStack:feature/infinite-queriesfrom Feb 19, 2023
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
TkDodo
added a commit
that referenced
this pull request
Feb 27, 2023
* feat: remove manual mode for infinite queries * refactor: simplify checking for next / previous fetch * types: better typings for fetchMeta.direction * refactor: fix hasNextPage / hasPreviousPage we should always return a boolean here, and according to the docs and the implementation in infiniteQueryBehaviour, we will only stop fetching if we return `undefined` from `getNextPageParam` or `getPreviousPageParam`. The checks for `false` or `null` on this boolean were likely wrong * fix: hasNextPage / hasPreviousPage is now always a boolean * feat: defaultPageParam * types: defaultPageParam is mandatory * fix: we also need `defaultPageParam` for `fetchInfiniteQuery` now * test: fix some assertions that relied on `undefined` being in `pageParams` * add some failing tests to show the problem with pageParam typings * feat: add PageParam typing (#5005) * feat: add PageParam typing * feat(infinite-query): more typing * feat(infinite-query): make pageParam never by defaukt * feat(infinite-query): PageParam type unknown for infinite queries * fix(infinite-query): fix tests * feat(infinite-query): add previous end next return TPageParam type * revert changes to pnpm-lock.yaml * types: add TPageParam to other framework adapters * fix(vue-query): correct generic typing * types: rename InfiniteQueryOptions to InfiniteQueryPageParamsOptions because it might be mistaken for a full set of options, which it is not * types: add failing select tests * fix formatting (new prettier version on v5) * types: add types for FetchMeta everywhere * feat(select): defer TData inference (#5040) * feat(select): defer TData inference * test(select): restore test * fix(select): change InfiniteQuery Observer definition * fix(infinite-queries): fix solid type inference select * fix(infinite-queries): fix solid type inference select * chore(infinite-queries): fix prettier * fix(infinite-queries): fix vue and svelte types * fix(infinite-queries): fix react type inference select * chore(infinite-queries): fix imports * style: fix prettier warnings * docs: docs for new infinite query features * docs: examples use new syntax --------- Co-authored-by: ecyrbe <ecyrbe@gmail.com> Co-authored-by: Damian Osipiuk <osipiukd+git@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added typing, tell me if it's what you needed ?