Search code examples
javascriptpythonfirebasefirebase-realtime-databaseeel

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 firabase got updated, then the javascipt 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 anyway 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');
  }});

Solution

  • answer : python eel is not supposed to be realtime :<