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?
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.