onDataSync
A nullable property to set a function or lambda for responding to DataSync realtime events. This function is invoked whenever a DataSync create/update/delete event is received.
A single subscribed ref-channel delivers a mix of DataSync leaf types (user/channel/entity plus the membership/relationship and propagated events about it), so branch on the sealed com.pubnub.api.models.consumer.pubsub.datasync.PNDataSyncEventResult.extractedMessage.
Note that this property allows for the assignment of a singular behavior at a time, as any new assignment will override the previous one. For scenarios requiring multiple behaviors, it is advisable to utilize EventEmitter.addListener.
To deactivate the current behavior, simply set this property to null.