[Database] Add more accurate comments of expected behaviour of Reference.on()

This commit is contained in:
Aleck Greenham
2017-05-09 08:09:03 +01:00
parent 4177e3e6bb
commit 9d5cc856c7

View File

@@ -135,14 +135,19 @@ export default class Reference extends ReferenceBase {
}
/**
* Called once with the initial data at the specified location and then once each
* time the data changes.
* iOS: Called once with the initial data at the specified location and then once each
* time the data changes. It won't trigger until the entire contents have been
* synchronized.
*
* Android: (@link https://github.com/invertase/react-native-firebase/issues/92)
* - Array & number values: Called once with the initial data at the specified
* location and then twice each time the value changes.
* - Other data types: Called once with the initial data at the specified location
* and once each time the data type changes.
*
* @callback onValueCallback
* @param {!DataSnapshot} dataSnapshot - Snapshot representing data at the location
* specified by the current ref. It won't trigger (.val() won't return a value)
* until the entire contents have been synchronized. If location has no data, .val()
* will return null.
* specified by the current ref. If location has no data, .val() will return null.
*/
/**