Closed larssn closed 7 years ago
Thanks for bringing this up! I'll look into what can be done to solve this. 👍
@larssn I'm curious about your use case. Do you need access the the snapshot while offline? Would it be acceptable to just get the snap only while online?
The issue I'm running into is that the snapshot contains functions, and it doesn't look like localForage is designed to store functions.
The use case in our case is in the context of a mobile app: The user can run in and out of wifi-range potentially, and transparency in regards to whether you are online or offline would be nice.
However, I can see that it might be hard to create snapshot functionality when offline.
So my suggestion is: Keep it simple, remove support for data snapshots completely so it doesn't confuse anyone. Maybe make a note of it in the readme.
Sounds good! Thanks @larssn
When you reference a location you can send the param in the topic, for example:
this.db.object('users/user1', {preserveSnapshot: true})
However this param gets ignored in AFO.
The param is described here: https://github.com/angular/angularfire2/blob/master/docs/2-retrieving-data-as-objects.md#retrieving-the-snapshot