Skip to content

feat: add PageParam typing #5005

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

Merged

Conversation

ecyrbe
Copy link
Contributor

@ecyrbe ecyrbe commented Feb 19, 2023

Added typing, tell me if it's what you needed ?

@vercel
Copy link

vercel bot commented Feb 19, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated
query ⬜️ Ignored (Inspect) Feb 19, 2023 at 2:36PM (UTC)

@TkDodo TkDodo merged commit 91dd479 into TanStack:feature/infinite-queries Feb 19, 2023
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>
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