spaceuptech / space-api-java

Apache License 2.0
5 stars 3 forks source link

Added LiveQuery Options #25

Closed AliabbasMerchant closed 5 years ago

AliabbasMerchant commented 5 years ago

@YourTechBud I have added an example in docs/LiveQuery.java

AliabbasMerchant commented 5 years ago

@YourTechBud Done

YourTechBud commented 5 years ago

@AliabbasMerchant shouldn't onSnapshot take 3 parameters now. The first is the array of docs (this will be an empty array when changesOnly is true). Second is the kind / type of change. Third is the doc(s) which changed.

AliabbasMerchant commented 5 years ago

I have kept them the same. Even in Python.
If changesOnly is false, it works the same.
If it is true, it calls onSnapshot with the individual changes(in List, so as not to cause any inconsistencies) as the docs. And second parameter as the type of change

YourTechBud commented 5 years ago

@AliabbasMerchant we will need three parameters. Often we need to check what has changed even when changeOnly is false

AliabbasMerchant commented 5 years ago

So when changeOnly is false, even then do we send the changed items?

YourTechBud commented 5 years ago

We send all three all the time. Changed items is passed irrespective of the value of changeOnly. Docs will always be an empty array when changeOnly is true.