Merge pull request #65 from greena13/refence_isEqual
[js][database] Add ref().isEqual()
This commit is contained in:
commit
fac0efa9d0
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue