Update data from firebase without refreshing when using Python Eel

I am trying to make a firebase python program with GUI using python eel.

but if the data in firebase got updated, then the javascript need to refresh the page to get the new data from firebase in a realtime.

the problem is python eel will stop the program if the page refreshed or closed.

is there any way I can get data from firebase without refreshing the page?

here is the code javascript code:

dbRefObject.on("value", function(snapshot) {
    var bool = snapshot.child('command').exists();
    if(bool){
    var text = snapshot.child('command/text').val();
    var type = snapshot.child('command/type').val();
    var time = snapshot.child('command/time').val();
      if(text !== 'default'){
          console.log("data updated");
          eel.main(text,time,type);
      }
      else{
      console.log("no command yet");
      }
  }
  else{
    seturl('login.html');
  }});