11import { firestore } from './interfaces' ;
22
33import { Observable , combineLatest } from 'rxjs' ;
4- import { shareReplay , map , first , distinct } from 'rxjs/operators' ;
4+ import { shareReplay , map , first } from 'rxjs/operators' ;
55import { GeoFirePoint , Latitude , Longitude } from './geohash' ;
66import { setPrecsion } from './util' ;
77import { FeatureCollection , Geometry } from 'geojson' ;
8- // import isEqual from 'lodash.isequal';
98
109export type QueryFn = ( ref : firestore . CollectionReference ) => firestore . Query ;
1110
@@ -97,6 +96,10 @@ export class GeoFireCollectionRef {
9796 this . stream = createStream ( this . query || this . ref ) . pipe ( shareReplay ( 1 ) ) ;
9897 }
9998
99+ obsv ( ) {
100+ return new Observable ( ) ;
101+ }
102+
100103 // GEO QUERIES
101104 /**
102105 * Queries the Firestore collection based on geograpic radius
@@ -118,13 +121,10 @@ export class GeoFireCollectionRef {
118121
119122 const queries = area . map ( hash => {
120123 const query = this . queryPoint ( hash , field ) ;
121- return createStream ( query ) . pipe (
122- snapToData ( )
123- // distinct(isEqual)
124- ) ;
124+ return createStream ( query ) . pipe ( snapToData ( ) ) ;
125125 } ) ;
126126
127- return combineLatest ( ...queries ) . pipe (
127+ const combo = combineLatest ( ...queries ) . pipe (
128128 map ( arr => {
129129 const reduced = arr . reduce ( ( acc , cur ) => acc . concat ( cur ) ) ;
130130 return reduced
@@ -146,6 +146,8 @@ export class GeoFireCollectionRef {
146146 } ) ,
147147 shareReplay ( 1 )
148148 ) ;
149+
150+ return combo ;
149151 }
150152
151153 private queryPoint ( geohash : string , field : string ) {
0 commit comments