I have an important question that I’m starting to face on 80% of the cases.
Lets say I have this:
var bcount = properties.count;
bcount.change(function() { favicon.badge(bcount); });
properties.count = its a number that changes depending on the user actions.
favicon.badge its a javascript that shows the action, which is working good.
I tried to use .change on the bcount var, but is giving me error as I supposed because is not an element.
Is there any way to listen a var when value changes?
PS: The problem I’m facing is that when the count gets updated, with a new number. It only updates after refreshing the page.
If properties is an object, it is fairly easy to observe using a Proxy. When a change is detected, you can check if it was the count property that changed and do something.