in packages/geofire/src/GeoQuery.ts [311:325]
private _childRemovedCallback(locationDataSnapshot: DatabaseTypes.DataSnapshot): void {
const key: string = geoFireGetKey(locationDataSnapshot);
if (key in this._locationsTracked) {
this._firebaseRef.child(key).once('value', (snapshot: DatabaseTypes.DataSnapshot) => {
const location: Geopoint = (snapshot.val() === null) ? null : decodeGeoFireObject(snapshot.val());
const geohash: Geohash = (location !== null) ? geohashForLocation(location) : null;
// Only notify observers if key is not part of any other geohash query or this actually might not be
// a key exited event, but a key moved or entered event. These events will be triggered by updates
// to a different query
if (!this._geohashInSomeQuery(geohash)) {
this._removeLocation(key, location);
}
});
}
}