You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have stumbled upon this a few times now, I am not sure if this is a bug or I just fail to understand the concept here:
If there is both a change listener and a derived property depending on the same property and the change listener accesses the derived property it seems that the change listener is executed first, the derived property gets updated after that. I would expect that all derived properties are already updated when the change events are triggered.
See example code on requirebin:
With this output:
B sees A changed to: 2
Trigger on A thinks B is: 2
B sees A changed to: 2
Trigger on A thinks B is: 2
B sees A changed to: 3
Trigger on A thinks B is: 3
B sees A changed to: 4
While the derived property gets updated for every change, the trigger seems unable to access B after the last change. Also the derived property is calculated 4 times in total, twice for number 2, why?
If line 23 is removed, the derived property is calculated only 3 times as expected. Why does accessing a derived property change how often it is calculated? That should only depend on its deps, right?
The text was updated successfully, but these errors were encountered:
I have stumbled upon this a few times now, I am not sure if this is a bug or I just fail to understand the concept here:
If there is both a change listener and a derived property depending on the same property and the change listener accesses the derived property it seems that the change listener is executed first, the derived property gets updated after that. I would expect that all derived properties are already updated when the change events are triggered.
See example code on requirebin:
With this output:
While the derived property gets updated for every change, the trigger seems unable to access B after the last change. Also the derived property is calculated 4 times in total, twice for number 2, why?
If line 23 is removed, the derived property is calculated only 3 times as expected. Why does accessing a derived property change how often it is calculated? That should only depend on its deps, right?
The text was updated successfully, but these errors were encountered: