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

Select with export options[] is being processed twice at startup and for every change in a reactive stament #4417

Closed
Sarodus opened this issue Feb 15, 2020 · 4 comments
Labels
awaiting submitter needs a reproduction, or clarification stale-bot

Comments

@Sarodus
Copy link

Sarodus commented Feb 15, 2020

Describe the bug
TL;DR See the Repl, should be self-explainatory if you change an options and see the console.

I wanted to make a Select component with reactive declarations to filter the options[] provided..

But the reactive declarations with the options[], are called every time the select's bind:value changes, the options are not changing. why it it called more than once?

To Reproduce
REPL

Expected behavior
Reactive stament should only be recalled if any variable it "watches" changes.

Severity
Low, but if i provide a lof of options in the array, it slows the UI to recalculate the same thing

@antony
Copy link
Member

antony commented Feb 16, 2020

When you export a variable, it is mutable from the outside, so I can sort-of see why it might receive a state-update twice (once from the parent, and once for itself).

The fact it registers such an update even though the value of the object itself hasn't changed could be improved by doing a deeper comparison, but I'm not 100% sure this would be the case, and I'm not sure what impact this might have on performance.

@antony antony added the awaiting submitter needs a reproduction, or clarification label Feb 16, 2020
@Sarodus
Copy link
Author

Sarodus commented Feb 20, 2020

@stale
Copy link

stale bot commented Jun 27, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Jun 27, 2021
@stale
Copy link

stale bot commented Jul 11, 2021

This issue has been closed as it was previously marked as stale and saw no subsequent activity.

@stale stale bot closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification stale-bot
Projects
None yet
Development

No branches or pull requests

2 participants