Skip to content

fix(types): adapt type definition of dataOrUpdater in setQueryData#540

Merged
tannerlinsley merged 1 commit intoTanStack:masterfrom
TkDodo:master
Jun 2, 2020
Merged

fix(types): adapt type definition of dataOrUpdater in setQueryData#540
tannerlinsley merged 1 commit intoTanStack:masterfrom
TkDodo:master

Conversation

@TkDodo
Copy link
Copy Markdown
Collaborator

@TkDodo TkDodo commented Jun 2, 2020

closes #506

since the updater receives `T | undefined`, it is difficult to construct a `T` from that. oldData can legitimately be `undefined`, but since `getQueryData` can also return `undefined` at any point, it makes more sense to have the updater be able to return `undefined` as well, which also means that `data` itself can be `undefined`
@TkDodo
Copy link
Copy Markdown
Collaborator Author

TkDodo commented Jun 2, 2020

Not sure what I should do against the broken link checker, this seems unrelated:

HTTPSConnectionPool(host='upc.ch', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
https://upc.ch

Also, some more questions please:

  1. is dtslint part of the PR checks? I am getting a bunch of errors locally:
see `dtslint` errors
ERROR: 621:44  no-unnecessary-generics  Type parameter TError is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 632:44  no-unnecessary-generics  Type parameter TError is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 649:44  no-unnecessary-generics  Type parameter TError is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 661:44  no-unnecessary-generics  Type parameter TError is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 683:44  no-unnecessary-generics  Type parameter TError is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 686:57  no-unnecessary-generics  Type parameter T is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
ERROR: 701:14  no-unnecessary-generics  Type parameter TResult is used only once. See: https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md
  1. Should I add some tests to types/test.ts for the type amendments I have made?

  2. the format script doesn't format .ts files (and doesn't run on the types directory in general), which is why the types/test.ts file is not formatted with it. Is this worth addressing or is this maybe on purpose?

Thanks

@tannerlinsley
Copy link
Copy Markdown
Member

  1. It's not, but I'd like to get them fixed anyway. Low priority.
  2. If you'd like! More tests can't hurt.
  3. Again, I would love to update that, but it's low priority.

@tannerlinsley tannerlinsley merged commit b528564 into TanStack:master Jun 2, 2020
@tannerlinsley
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.5.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nx-cloud
Copy link
Copy Markdown

nx-cloud bot commented Dec 28, 2025

View your CI Pipeline Execution ↗ for commit 2533c93

Command Status Duration Result
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-15 02:05:05 UTC

GEREGUR pushed a commit to GEREGUR/query that referenced this pull request Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typeDefinition of updater function in setQueryData

2 participants