Merge pull request #65 from greena13/refence_isEqual

[js][database] Add ref().isEqual()
This commit is contained in:
Michael Diarmid 2017-04-22 22:12:42 +01:00 committed by GitHub
commit fac0efa9d0
1 changed files with 11 additions and 0 deletions

View File

@ -337,6 +337,17 @@ export default class Reference extends ReferenceBase {
return this.path; 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 * GETTERS
*/ */