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
The listener that is passed to observe(listener, options) is a function that is provided two values, 'newvalue' and 'oldvalue when the property it was registered for in the model was changed. However once inside the listener function, there is no way to know what property these values correspond to.
For example say you are trying to set up all your observers dynamically like this in a for loop
Once inside the function there is no knowledge of the property change which activated this function call, therefore you cannot run any code that depends on the name of that property.
Can this be added as a third parameter to the listener - like function(newValue, oldValue, property)?
The text was updated successfully, but these errors were encountered:
The listener that is passed to observe(listener, options) is a function that is provided two values, 'newvalue' and 'oldvalue when the property it was registered for in the model was changed. However once inside the listener function, there is no way to know what property these values correspond to.
For example say you are trying to set up all your observers dynamically like this in a for loop
Once inside the function there is no knowledge of the property change which activated this function call, therefore you cannot run any code that depends on the name of that property.
Can this be added as a third parameter to the listener - like function(newValue, oldValue, property)?
The text was updated successfully, but these errors were encountered: