Listening to multiple nodes #153
-
In Firebase RealtimeDB web sdk you are able to install listener for multiple nodes like
You can add one listener to Node1, SubNode2 and SubNode3 with one call/socket. Now for Firebase Delphi implementation, as I see on your documentation https://github.com/SchneiderInfosystems/FB4D/wiki/FB4D-Reference-IRealTimeDB#install-a-listener-for-changes-in-a-json-node I can add a listener to a particular JSON node, so in my case I have a) to add 3 listeners to listen those 3 specific nodes or b) add a listener to the whole tree. I dont like either because a) I have to open 3 sockets or b) reading the whole tree will bring me unnecessary changes/data from other nodes. Any thoughts about it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
In this situation, I reconmend to use more than one instance of IRealTimeDB. Please inform me here, if this solves your task. |
Beta Was this translation helpful? Give feedback.
-
I was able to listen two different nodes but using two IFirebaseEvent and one IRealTimeDB, instead of two IRealTimeDB instances as you proposed. I think its much better. Example code for other users:
|
Beta Was this translation helpful? Give feedback.
I was able to listen two different nodes but using two IFirebaseEvent and one IRealTimeDB, instead of two IRealTimeDB instances as you proposed. I think its much better. Example code for other users: