deepstreamNet icon indicating copy to clipboard operation
deepstreamNet copied to clipboard

DeepStreamRecords - expose RecordUpdated, RecordPatched events

Open grendo opened this issue 8 years ago • 4 comments

Hi, I am after an event when a whole record is changed from deepstream. The PropertyChanged is a bit to granular for my need as I only want one event each time you receive updates from deepstream for a record. I am happy to do the pull request.

grendo avatar Oct 25 '17 20:10 grendo

What kind of data you want to see in the event args of such events?

Feel free to propose a PR for this.

schulz3000 avatar Oct 26 '17 16:10 schulz3000

I want to know when a record is updated from deepstream. RecordName and maybey the record. There are events on the connection class but they are internal.

Currently if I subscribe to the INotifyPropertyChange I get an event for every property that changed in a record when I only want 1 event.

grendo avatar Oct 26 '17 22:10 grendo

I understand. So I propose an API like this: client.Records.RecordPatched += (s, e) => { var record = e.Record; var path = e.Path; }; client.Records.RecordUpdated += (s, e) => { var record = e.Record; }; The Record member in EventArgs should be from type IDeepStreamRecord. If you need the name you can get it via e.Record.RecordName

I'm waiting for your PR :smile:

schulz3000 avatar Oct 29 '17 08:10 schulz3000

yes that is fine, similar to the https://deepstreamhub.com/docs/client-java/RecordChangedCallback/

The path changed event would be handled by the existing property change event https://deepstreamhub.com/docs/client-java/RecordPathChangedCallback/

grendo avatar Nov 01 '17 21:11 grendo