Skip to content

Conversation

@guendev
Copy link
Owner

@guendev guendev commented Oct 17, 2025

No description provided.

Copilot AI review requested due to automatic review settings October 17, 2025 07:04
@guendev guendev merged commit 4ed0ce8 into main Oct 17, 2025
3 checks passed
Copy link

Copilot AI left a 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 onResult to onResultEvent
  • 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) => {
Copy link

Copilot AI Oct 17, 2025

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.

Suggested change
* onResultEvent((data, context) => {
* onResult((data, context) => {

Copilot uses AI. Check for mistakes.
}
}
catch (e) {
error.value = e as ErrorLike
Copy link

Copilot AI Oct 17, 2025

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.

Suggested change
error.value = e as ErrorLike
error.value = e as ErrorLike
void onErrorEvent.trigger(error.value, { client })

Copilot uses AI. Check for mistakes.
}
else if (isDefined(result.value)) {
void onResult.trigger(result.value, { client })
}
Copy link

Copilot AI Oct 17, 2025

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.

Copilot uses AI. Check for mistakes.
@guendev guendev deleted the ssr-fix-2 branch October 25, 2025 18:08
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