I have a custom object in JavaScript:
function Graph (dataType, provider){
this.dataType = dataType;
this.provider = provider;
}
I instantiate this object via "new" and then pass it to other parts of my code that may need to keep track of changes to this object's properties.
When the properties of the Graph object are modified, I want all other consumers of that object to be notified. In languages like C# I would have a setter in which I would raise an event. What is a proper way to create events in custom JavaScript objects?