T
TanStack3mo ago
flat-fuchsia

Typescript DX assistance "request"?

Hey guys, I'm relatively new to this library. While I find it's mental model exciting, and I really like inferred types, I feel like core Typescript DX is really strange I know that rules recommend don't insert much screenshorts, but I promise, they're not context-overwhelming Here's what I mean by TS DX: For instance, I want to use hook. useQuery. I write it, import, but then I forget what it actually accepts and how can I configure queryOptions I hover over the method and see... some TS wizzardy going on. I press command + click, and still, even bigger chunk of index.d.ts TS appears in front of my screen, completely forcing me to alt-tab from my source code and switch back to documentation website and seek for help. I think it's really really strange experience For instance - that's how things done in Angular/RxJS. It's not giving you full overview of the picture, but it makes you NOT leave your source code 3/4 times Maybe I'm using the library wrong and there's an easier flow, please, share your experience
No description
No description
No description
No description
2 Replies
conscious-sapphire
conscious-sapphire3mo ago
We totally need to get better with JsDoc
extended-salmon
extended-salmon3mo ago
I'd love this as well. At a minimum, I think just having a link to the docs itself would be a good starting point. I have plenty of custom abstractions on things like getQueryData that where I don't feel it necessary to write a massive JSDoc block, just have an @see {@link https://docs-url} so that my team-members can quickly access the docs for what said function is doing. I couldn't find any, but is there any JSDoc at all in Tanstack query or any suggested way across the tanstack ecosystem to write jsdoc? I'd love to just go in and add a couple of paragraphs for some of the commonly used things like useQuery and useMutation to get a feel for how these could work - I know that what olst is describing here is absolutely valuable

Did you find this page helpful?