DEV Community

Discussion on: Create a never offline web app!

Collapse
 
mukherjee96 profile image
Aritra Mukherjee

Hi! I have been trying to find how I can check whether a document 'create', 'update' or 'delete' happened on the cache when the device is offline.

The official documentation for AngularFire and Firestore only talks about ways to check whether you're receiving data from the server or the cache.

Collapse
 
paco_ita profile image
Francesco Leardini

Hi Aritra.

Have a look here: firebase.google.com/docs/firestore...

You can use addSnapshotListener for your requirement:
"Local writes in your app will invoke snapshot listeners immediately. This is because of an important feature called "latency compensation." When you perform a write, your listeners will be notified with the new data before the data is sent to the backend."

Collapse
 
mukherjee96 profile image
Aritra Mukherjee

Thanks a lot! This is exactly what I was looking for. 🙂