0

I have an app that displays a list of items. Here is what I am doing.

  1. When the app first loads I am making an HTTP request to get the list from the firebase database.
  2. once the list is received the list is stored locally on localStorage for future use.
  3. On future app loads, the list is loaded from localStorage to prevent unnecessary http calls

I am doing the above programmatically, i.e, saving data to localStorage and check for new data and getting it etc.

Does firebase provide any other way to the same?

krv
  • 2,830
  • 7
  • 40
  • 79

1 Answers1

2

There is no built-in support for cross page-reload persistence in the JavaScript SDK for the Firebase Realtime Database. Somebody is working on such functionality in the open-source repository, but no release was made with it yet.

If you need this functionality, I highly recommend looking into using Cloud Firestore. In addition to many other benefits, it supports cross page-reload persistence.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807