dalenguyen / firebase-wordpress-plugin

A plugin that helps to integrate Firebase to WordPress
https://firebase-wordpress-docs.readthedocs.io
GNU General Public License v2.0
110 stars 31 forks source link

Realtime updates for realtime database and firestore #134

Closed saul-hdez closed 2 years ago

saul-hdez commented 3 years ago

It would be greate if we could select between just getting the data once or set an active listener for firestore in javascript it would be like the difference between .get() vs .onSnapshot()

dalenguyen commented 3 years ago

Hi @saul-hdez, what are your use cases for this?

For edge cases, it always can be achieved by using a custom script:

https://firebase-wordpress-docs.readthedocs.io/en/latest/developer/add-custom-scripts.html

saul-hdez commented 3 years ago

i need to create a dashboard that feeds form different collections and updates in Realtime without needing to reload the page i know it can be done with custom script + custom shortcode but figured its a simple modification that could be implemented for anybody

skwasha commented 3 years ago

The docs say "Dynamically Display Firestore Data on WordPress". Am I to understand then that the above is still the case and that on page load it's doing .get() and not .onSnapshot()? If so, has anyone validated that the real-time updates via a custom script work as expected? I have a similar use case to the above, where I need a dashboard updated without a page reload. @dalenguyen

dalenguyen commented 2 years ago

@skwasha using custom script should works as expected since you have control over the method that using for getting the data.