[js][database] Add ref().isEqual()
This commit is contained in:
parent
898217ff6c
commit
3277126fb4
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue