Many Firebase Elements Slow Down Everything

In the true Polymer mode, I build all my elements as separate components that can be reused. My application uses the Firebase database and elements of the firebase element to display the data and does a great job of it, but elementizing my application means it creates a gazillion Firebase instances that I think. Should I put it in a window and share it between everyone, or is there a more graceful decision.

Thank you, million!

+5
source share
2 answers

Try to free some listeners. You probably have some duplicates as Firebase overload listeners.

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

0
source
  • Try using the Firebase offline data synchronization feature. It synchronizes your data with Firebase servers and other clients based on "best effort." Thanks to this, your application will remain responsive regardless of network latency or Internet connection.

    persistenceEnabled = YES;

  • Also try the keepSynced function, you can maintain synchronization on every path.

    ref.keepSynced (true);

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

0
source

Source: https://habr.com/ru/post/1234686/


All Articles