5

In true Polymer fashion I'm building all of my elements as stand alone components that could be reused on their own. My app uses a Firebase database and the firebase-element elements to show data, and does a marvellous job at this, but the elementisation of my app means that it creates a gazillion Firebase instances I think. Should I put one on the window and share that between all of them, or is there a more gracious solution.

Thanks a million!

radia
  • 1,456
  • 1
  • 13
  • 18
Boris
  • 737
  • 6
  • 18
  • I don´t know what polymer is but in my last firebase application I make each entry as an Object that I get all and do the Objects in a List without any performance issues, can you specify your architecture ? – FoldFence Mar 23 '16 at 10:33
  • 1
    This has largely been fixed by the new `Polymerfire` element by the Firebase and Polymer teams. – Boris Aug 29 '16 at 14:39

2 Answers2

0

Try to release some listeners. You probably have some duplicates as firebase overloads listeners.

https://www.firebase.com/docs/web/guide/retrieving-data.html#sts=Detaching%20Callbacks

sivi
  • 10,654
  • 2
  • 52
  • 51
  • The problem is the initial load of all my elements, they are all independent of each other and the time it takes is unacceptable – radia Mar 25 '16 at 10:31
0
  1. Try Firebase Offline Data Synchronization feature. It synchronizes your data with the Firebase servers and with other clients on a 'best-effort' basis. By this your app will remain responsive regardless of network latency or Internet connectivity.

    persistenceEnabled = YES;

  2. Also try keepSynced feature, You can be maintainthe sync on a per-path basis.

    ref.keepSynced(true);

    https://firebase.googleblog.com/2015/05/announcing-mobile-offline-support_93.html

Karthi R
  • 1,338
  • 10
  • 25