Closed iahvector closed 9 years ago
One could certainly do this, you're right.
But sending all records through onDataAdded(...)
, no matter if old or just created, is how Meteor and this library work.
Regarding the SubscribeListener
, you got that right: By waiting for onSuccess(...)
to be called, you know when the initial data set has been transferred.
So you can handle this yourself, however you want this to handle. Every user of this library is thus free to adapt this to their architecture: Some may just want to ignore the initial data set, some will want to store it locally, etc.
Anyway, you got all the concepts right and understood this correctly.
Hi, I noticed that when a subscription is successful, an
onDataAdded
event is fired for each record of the data loaded by the subscription (data existing in the database up to the subscription time). Wouldn't theonDataAdded
event be better fired only when new data is added after the subscription? The data loaded by the subscription can be delivered in theonSuccess
callback of theSubscriberListener
.