-
-
Notifications
You must be signed in to change notification settings - Fork 1
Remove unnecessary computed() #133
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 removes unnecessary computed()
wrapping from arrow endpoint properties in the FancyArrow component. The changes simplify the code by converting computed properties to direct property access since the endpoint compilation doesn't need reactive updates.
- Adds a type guard function
isSnapTarget
to improve type safety - Removes
computed()
wrappers fromfrom
andto
properties - Updates type checking logic to use the new type guard function
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
components/parse-option.ts | Adds isSnapTarget type guard function for better type safety |
components/FancyArrow.vue | Removes unnecessary computed() wrappers and updates type checking logic |
y: props.y2, | ||
}), | ||
); | ||
const from = compileArrowEndpointProps({ |
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.
Removing computed()
may break reactivity. If any of the props (from, q1, id1, pos1, x1, y1) change, the from
value will not update automatically, potentially causing stale data to be used in the component.
Copilot uses AI. Check for mistakes.
const to = compileArrowEndpointProps({ | ||
shorthand: props.to, | ||
q: props.q2, | ||
id: props.id2, | ||
pos: props.pos2, | ||
x: props.x2, | ||
y: props.y2, | ||
}); |
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.
Removing computed()
may break reactivity. If any of the props (to, q2, id2, pos2, x2, y2) change, the to
value will not update automatically, potentially causing stale data to be used in the component.
Copilot uses AI. Check for mistakes.
Reactivity is needed as #134 |
No description provided.