From 9bd999678c9ff83955e6736aa574d963cbb153d5 Mon Sep 17 00:00:00 2001 From: Dhaivat Pandya Date: Tue, 21 Jun 2016 15:50:20 -0700 Subject: [PATCH] fixed undefined issue --- src/QueryManager.ts | 5 +---- src/scheduler.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/QueryManager.ts b/src/QueryManager.ts index 70f700a5da4..e0073253a01 100644 --- a/src/QueryManager.ts +++ b/src/QueryManager.ts @@ -1,7 +1,6 @@ import { NetworkInterface, Request, - BatchedNetworkInterface, } from './networkInterface'; @@ -137,15 +136,13 @@ export class QueryManager { this.queryTransformer = queryTransformer; this.pollingTimers = {}; - const isBatchingInterface = - (typeof (this.networkInterface as BatchedNetworkInterface).batchQuery) !== 'undefined' this.queryListeners = {}; this.scheduler = new QueryScheduler({ queryManager: this, }); this.batcher = new QueryBatcher({ //we batch if the network interface supports batching if user has not specified - shouldBatch: typeof shouldBatch === "undefined" ? isBatchingInterface : shouldBatch, + shouldBatch, networkInterface: this.networkInterface, }); this.batcher.start(this.batcherPollInterval); diff --git a/src/scheduler.ts b/src/scheduler.ts index 910612ad53e..ef3ca4cb67b 100644 --- a/src/scheduler.ts +++ b/src/scheduler.ts @@ -43,7 +43,7 @@ export class QueryScheduler { } public checkInFlight(queryId: string) { - return (this.inFlightQueries[queryId] !== undefined); + return this.inFlightQueries.hasOwnProperty(queryId); } public fetchQuery(queryId: string, options: WatchQueryOptions) {