Skip to content
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

fix: should not trigger effects if computed value is not changed #6996

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

Varixo
Copy link
Member

@Varixo Varixo commented Oct 23, 2024

Fixes: #4918

@Varixo Varixo self-assigned this Oct 23, 2024
@Varixo Varixo requested a review from a team as a code owner October 23, 2024 14:53
Copy link

changeset-bot bot commented Oct 23, 2024

🦋 Changeset detected

Latest commit: 874d026

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Oct 23, 2024

Open in Stackblitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@6996
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/city@6996
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@6996
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@6996

commit: 874d026

Copy link
Contributor

github-actions bot commented Oct 23, 2024

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ❌ Failed (View Log) 874d026

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just two questions

packages/qwik/src/core/signal/signal.ts Outdated Show resolved Hide resolved
signal = previousSignal;
if (effect instanceof ComputedSignal || effect instanceof WrappedSignal) {
try {
retryOnPromise(() => effect.$invalidate$());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should force() not also use this API then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

force don't use computeIfNeeded so probably not needed

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@wmertens wmertens merged commit e0aeb11 into build/v2 Oct 24, 2024
19 checks passed
@wmertens wmertens deleted the v2-fix-4918 branch October 24, 2024 21:58
@Varixo Varixo linked an issue Oct 27, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[🐞] useComputed$ needs to do an equals check
2 participants