Skip to content

perf(computed): avoid updates when source signal value is restored #15

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

Closed
wants to merge 10 commits into from

Conversation

johnsoncodehk
Copy link
Collaborator

@johnsoncodehk johnsoncodehk commented Dec 21, 2024

This PR relies on changes from #14.

Consider the following situation:

const s = signal(false);
const c = computed(() => s.get());
c.get();
s.set(true);
s.set(false);
c.get(); // <-- should not recalculate

In the last line c.get() should not cause computed to perform the getter because the value of s is restored.

@johnsoncodehk johnsoncodehk changed the title perf: store value instead of version number in Link for dirty check perf(computed): store value instead of version number in Link for dirty check Dec 21, 2024
@johnsoncodehk johnsoncodehk marked this pull request as ready for review December 21, 2024 16:45
@johnsoncodehk johnsoncodehk changed the title perf(computed): store value instead of version number in Link for dirty check perf(computed): avoid updates when source signal value is restored Dec 21, 2024
@johnsoncodehk
Copy link
Collaborator Author

Close due to #19 changes, the solution is no longer feasible.

@johnsoncodehk johnsoncodehk deleted the smarter-computed branch December 23, 2024 10:49
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.

1 participant