(Typo in Sample Code) Using “change” instead of “child_changed” to monitor devices

StackOverflow https://stackoverflow.com//questions/25003839

  •  20-12-2019
  •  | 
  •  

Pregunta

I was looking through nest's example code, and in the javascript/smoke_alarm example they use alarm.on('change', function(snapshot) {...} instead of using alarm.on('child_changed', function(snapshot) {...}.

I don't see any documentation for 'change' in the firebase docs, and it raises an error when I use it:

  Error: Query.on failed: First argument must be a valid event type: "value",  
  "child_added", "child_removed", "child_changed", or "child_moved".

Is this just a bug in the sample code, and it should really read: alarm.on('child_changed', function(snapshot) {...}? Or am I missing something?

¿Fue útil?

Solución

Sorry about that, it is a typo. The sample code has now been updated.

Due to the nature of HTML5 Notifications, it currently works best in Safari, but I also modified the sample to log events in a for other browsers so you can focus on the Nest specific code.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top