Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
How to continiously read data change from firebase realtime database in vue.js

I am using vue.js version 2 with cdn mode. I have created 2 vue components. One components is pushing the data to database and the other component will show it. Below is the code

firebase.database().ref().on('value', function (data) {
      console.log("called");
      console.log("data received " + JSON.stringify(data));
    });

I want to read data continuously, but above method is not working. It reads the data only one time. How to solve this issue so that I can read the data continuously ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I have done this in vue like this

import {  onValue,  ref as Ref} from "firebase/database";

onValue(Ref(db, path), (snapshot) => {
         // you get value here
         //snapshot.val());
    });

// where db is the main Database reference
// and path is the path inside db

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda