Skip to content

Commit

Permalink
Subscribing to getSubscriptionConnectionObservable returns last known…
Browse files Browse the repository at this point in the history
… state (#285)
  • Loading branch information
2ndalpha authored Jan 19, 2021
1 parent 3d14116 commit 37e657c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qminder-api",
"version": "3.0.0",
"version": "3.0.1",
"description": "Qminder Javascript API. Makes it easy to leverage Qminder capabilities in your system.",
"directories": {
"test": "test"
Expand Down
3 changes: 2 additions & 1 deletion src/services/GraphQLService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import WebSocket, {MessageData} from '../lib/websocket-web';
import ApiBase, {GraphqlResponse} from '../api-base';
import {Observable, Observer, Subject} from 'rxjs';
import { GraphqlBatcher } from '../graphql-batcher';
import { shareReplay } from "rxjs/operators";

interface OperationMessage {
id?: string;
Expand Down Expand Up @@ -57,7 +58,7 @@ class GraphQLService {

private connectionStatus: ConnectionStatus;
private connectionSubject = new Subject<ConnectionStatus>();
private connection$ = this.connectionSubject.pipe();
private connection$ = this.connectionSubject.pipe(shareReplay(1));

private nextSubscriptionId: number = 1;

Expand Down

0 comments on commit 37e657c

Please sign in to comment.