[js][database] Add ref().isEqual()

This commit is contained in:
Aleck Greenham 2017-04-22 17:59:04 +01:00
parent 898217ff6c
commit 3277126fb4
1 changed files with 11 additions and 0 deletions

View File

@ -337,6 +337,17 @@ export default class Reference extends ReferenceBase {
return this.path;
}
/**
* Returns whether another Reference represent the same location and are from the
* same instance of firebase.app.App - multiple firebase apps not currently supported.
* @param {Reference} otherRef - Other reference to compare to this one
* @return {Boolean} Whether otherReference is equal to this one
* {@link https://firebase.google.com/docs/reference/js/firebase.database.Reference#isEqual}
*/
isEqual(otherRef: Reference): boolean {
return !!otherRef && otherRef.constructor === Reference && otherRef.key === this.key;
}
/**
* GETTERS
*/