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

There is no way to dynamically change forceRender property #4

Closed
krydos opened this issue Dec 30, 2019 · 3 comments
Closed

There is no way to dynamically change forceRender property #4

krydos opened this issue Dec 30, 2019 · 3 comments
Assignees

Comments

@krydos
Copy link

krydos commented Dec 30, 2019

hi @palerdot,
Thanks for the lib, it's great.

My current issue is that if forceRender property is initially true then I cannot change it to false dynamically.

My flow is this:

  • speedometer's forceRender = true
  • make http request to the server to get max value for the speedometer
  • set that max value and set forceRender to false because I don't need to update the whole speedometer anymore.
  • speedometer does not react to the change for forceRender = false

I believe it happens because of THIS LINE.

      this.force_render = newValue || oldValue

This code means that if newValue is false then we automatically apply oldValue which is true. So there is no way to set forceRender to be false if it is already true.

Could you please let me know if this piece of code is there intentionally or we can just apply value from newValue variable with no issues?

@palerdot
Copy link
Owner

@krydos Thanks for raising the issue. You are right. For boolean values, it is enough to just take the new values. so just

this.force_render = newValue

should be ok. I will try to add tests before publishing. Even without that, I will just try to release this as early as possible as v1.1.0. I will post updates on this issue.

@palerdot palerdot self-assigned this Jan 23, 2020
@palerdot palerdot changed the title There is no way to dinamically change forceRender property There is no way to dynamically change forceRender property Jan 25, 2020
@palerdot
Copy link
Owner

palerdot commented Jan 25, 2020

@krydos This issue is fixed and released in v1.1.0. A simple simulation of your scenario is in this codesandbox - https://codesandbox.io/s/vue-template-t5j5n.

Please update to v1.1.0 and see if it fixes your issue.

Please reopen this issue if you still face problems.

@krydos
Copy link
Author

krydos commented Jan 25, 2020

Brilliant, @palerdot. Thanks a lot!

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

No branches or pull requests

2 participants