Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
Firebase Realtime Database Property Listener

I have some data like so: leaderboards/board/{board id}/{child properties}

Screen capture of example data in Realtime Database

I have an added listener for boards, like so:

const boardRef = firebase.database().ref('leaderboards/board');
boardRef.on('child_added', (snapshot) => {
    // handle data
});

That part works fine. I then later want to listen to just a specific property on a board, to see if it changes. I do not want to listen to all child changes on the board, as a couple of the children can change really frequently and we don't want to be handling that much data except when needed (a certain app state). So, I tried this:

const endedRef = firebase.database().ref('leaderboards/board/123/ended');
endedRef.on('value', (snapshot) => {
    // handle data
});

However, when I update the 'ended' property in Firebase, the listener isn't called. It's only called when I first add the listener (so it appears to be hooked up properly) but then not when the property is changed. What's the proper way to solve this?

This post is similar, but as I'm already trying a 'value' listener on the property, seems to either not be a fix or not work for my data: How to listen to a specific value change in Firebase?

Thanks for any and all help!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This was related to something specific in my codebase, causing my listener removal to get triggered just after getting added. So if you're having a similar issue, check where you remove the listener!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda