From 82b94f0896159ef10c3f01e3dca93a5cd7367b10 Mon Sep 17 00:00:00 2001 From: Nicholas Jamieson Date: Fri, 17 Feb 2017 16:59:03 +1000 Subject: [PATCH] fix(database): use switchMap Closes #830. --- src/database/firebase_list_factory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/database/firebase_list_factory.ts b/src/database/firebase_list_factory.ts index 275324a1f..0dd296fb5 100644 --- a/src/database/firebase_list_factory.ts +++ b/src/database/firebase_list_factory.ts @@ -6,7 +6,7 @@ import { observeOn } from 'rxjs/operator/observeOn'; import { observeQuery } from './query_observable'; import { Query, FirebaseListFactoryOpts } from '../interfaces'; import * as utils from '../utils'; -import { mergeMap } from 'rxjs/operator/mergeMap'; +import { switchMap } from 'rxjs/operator/switchMap'; import { map } from 'rxjs/operator/map'; export function FirebaseListFactory ( @@ -32,7 +32,7 @@ export function FirebaseListFactory ( const queryObs = observeQuery(query); return new FirebaseListObservable(ref, subscriber => { - let sub = mergeMap.call(map.call(queryObs, query => { + let sub = switchMap.call(map.call(queryObs, query => { let queried: firebase.database.Query = ref; // Only apply the populated keys // apply ordering and available querying options