-
Notifications
You must be signed in to change notification settings - Fork 1
fix(core): rename onResult to onResultEvent in useQuery composable #16
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the internal onResult event hook to onResultEvent in the useQuery composable while maintaining the public API by keeping the exported property name as onResult.
Key Changes:
- Renamed internal event hook variable from
onResulttoonResultEvent - Updated all internal references to use the new variable name
- Updated documentation example to reflect the new variable name
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/core/src/composables/useQuery.ts | Renamed internal onResult variable to onResultEvent and updated all references |
| .changeset/sour-bars-eat.md | Added changeset documenting the internal refactoring |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| * @example | ||
| * ```ts | ||
| * onResult((data, context) => { | ||
| * onResultEvent((data, context) => { |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation example should show the public API usage with onResult, not the internal variable name onResultEvent. Users will call onResult.on() or destructure { onResult } from the composable.
| * onResultEvent((data, context) => { | |
| * onResult((data, context) => { |
| } | ||
| } | ||
| catch (e) { | ||
| error.value = e as ErrorLike |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of onErrorEvent.trigger() calls means error events are no longer being fired. This breaks the error handling functionality for consumers using the onError event hook.
| error.value = e as ErrorLike | |
| error.value = e as ErrorLike | |
| void onErrorEvent.trigger(error.value, { client }) |
| } | ||
| else if (isDefined(result.value)) { | ||
| void onResult.trigger(result.value, { client }) | ||
| } |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of the onResultEvent.trigger() call in the success case means result events are no longer being fired when queries complete successfully without errors. This breaks the functionality for consumers using the onResult event hook.
No description provided.