简体   繁体   中英

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');
  }});

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM