delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Any listener (or method) to find out if all the subscribed data was received from server? #148

Closed smahdis closed 6 years ago

smahdis commented 6 years ago

Imagine I have a collection with 100 (or any other number of) documents on the server.

I subscribe to this collection and everything is good.

But the problem is that I want to set a listener for when all these 100 documents are received.

When I start subscription, a loading is shown to the user but I don't know when to hide the loading because I don't know if all the data is received.

ocram commented 6 years ago

Isn’t that what the onSuccess method of the SubscribeListener callback tells you? You can pass that callback to the subscribe method. Let me know if that helps.

smahdis commented 6 years ago

Yep, that's exactly what I was seeking for.

Sorry for the stupid question.