HeyHeyJC
HeyHeyJC

Reputation: 2867

Google realtime API OBJECT_CHANGED event fired by (almost) anything happening?

Take a custom realtime object "MyObject" one property of which is an IndexReference referring to a CollaborativeList "MyList". "MyObject" also has a collaborative field property "MyProps" into which I put a json string.

In order to detect changes to "MyProps" I tried the following:

MyObject.addEventListener(gapi.drive.realtime.EventType.OBJECT_CHANGED, dealWithChanges);

However, when I make any change to an object in "MyList", which shouldn't affect the IndexReference in any way, the OBJECT_CHANGED event is fired on "MyObject"

Is this by design? It makes the OBJECT_CHANGED event useless, effectively a "something has changed somewhere" event, but without it there appears no way to detect a change to "MyProps".

Upvotes: 0

Views: 42

Answers (1)

Cheryl Simon
Cheryl Simon

Reputation: 46844

Object changed events bubble, so you can listen higher up the tree for anything that is happening lower.

To listen only for changes on collaborative fields within the particular custom object, you want a ValueChangedEvent

Upvotes: 1

Related Questions