Thursday, 17 January 2019

Designed question about Efficiently managing UI state with PouchDB

According to the Efficiently managing UI state with PouchDB documentation, we can do fetchInitialDocs().then(reactToChanges).catch(console.log.bind(console)); in order to first get all documents and then listen to live changes.

I imagine the case where a change occurs after fetchInitialDocs request is done but before the reactToChanges listener is established. This change might be ignored as far as I understand. According to the documentation, this case seems to never occur, can someone confirm it and explain why?

So the underlying question is: how can I safely get all documents (doc list A) and listen for all changes that came just after the one that leads to the doc list A?



from Designed question about Efficiently managing UI state with PouchDB

No comments:

Post a Comment