Real-time updates for Cloud functions
With Firebase, you can have real time listeners on Firestore documents, which allow to have your UI in sync with your data.
But when you ship logic in an app, you lose control over it.
If you want to be able to update that logic after shipping, you place it in the backend (Cloud Functions), but then you lose real time updates.
It would be amazing to have functions that can fire real-time events based on Firestore updates.
So the flow would be:
- There is an update in a Firestore document (or potentially other triggers like pub/sub, analitycs, etc.)
- A Cloud Dunction is called in your code where you can return arbitrary data.
- Any listeners open in the app would fire with the given data (in the same way Firestore listeners are fired).
It blew my mind as a developer when I learned I could listen to DB documents directly from the client. It opened up so many possibilities.
Imagine being able to do that but preserving the control on your code after deploying an app!