Skip to content

Commit

Permalink
fixed undefined issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Poincare authored and Sashko Stubailo committed Jun 21, 2016
1 parent f9ccf75 commit 9bd9996
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/QueryManager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
NetworkInterface,
Request,
BatchedNetworkInterface,
} from './networkInterface';


Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/scheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9bd9996

Please sign in to comment.