-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
docs(vue): change query keys example to typescript #9907
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
Conversation
This example is written in Javascript, and the fact that `todoId` is a `Ref` is a bit hard to identify. I propose to migrate this example to Typescript, with an import to Vue's Ref type and make the parameter to the example composable explicit. There are more docs that could be improved this way, if it suits you I could also make the changes to these docs :)
|
WalkthroughDocs example changed from JavaScript to TypeScript: Changes
Sequence Diagram(s)sequenceDiagram
participant Component as Vue Component
participant Hook as useTodos(todoId: Ref<string>)
participant Query as useQuery
participant Fetch as fetchTodoById(id)
Component->>Hook: call useTodos(todoIdRef)
Hook->>Query: init with queryKey [ 'todos', todoIdRef ]
Note over Query,Hook: queryFn reads todoIdRef.value
Query->>Fetch: fetchTodoById(todoIdRef.value)
Fetch-->>Query: todo data
Query-->>Component: data / status
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit f988098
☁️ Nx Cloud last updated this comment at |
🎯 Changes
This example is written in Javascript, and the fact that
todoIdis aRefis a bit hard to identify.I propose to migrate this example to Typescript, with an import to Vue's Ref type and make the parameter to the example composable explicit.
There are more docs that could be improved this way, if it suits you I could also make the changes to these docs :)
✅ Checklist
pnpm run test:pr.🚀 Release Impact
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.