in packages/geofire/src/GeoQuery.ts [123:143]
public cancel(): void {
// Mark this query as cancelled
this._cancelled = true;
// Cancel all callbacks in this query's callback list
this._callbacks = { ready: [], key_entered: [], key_exited: [], key_moved: [] };
// Turn off all Firebase listeners for the current geohashes being queried
const keys: string[] = Object.keys(this._currentGeohashesQueried);
keys.forEach((geohashQueryStr: string) => {
const query: string[] = this._stringToQuery(geohashQueryStr);
this._cancelGeohashQuery(query, this._currentGeohashesQueried[geohashQueryStr]);
delete this._currentGeohashesQueried[geohashQueryStr];
});
// Delete any stored locations
this._locationsTracked = {};
// Turn off the current geohashes queried clean up interval
clearInterval(this._cleanUpCurrentGeohashesQueriedInterval);
}