使用 Python Eel 时从 firebase 更新数据而不刷新

Update data from firebase without refreshing when using Python Eel

我正在尝试使用 python eel 制作一个带有 gui 的 firebase python 程序。

但是如果 firabase 中的数据更新了,那么 javascipt 需要刷新页面以实时从 firebase 获取新数据。

问题是python如果页面刷新或关闭,eel 将停止程序。

是否可以在不刷新页面的情况下从 firebase 获取数据?

这里是代码javascript代码:

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

回答:python鳗鱼不应该是实时的:<