Skip to content

Commit bb31d07

Browse files
authored
Update rxrpc-client.ts (#9)
Replace shareReplay with share becasue JavaScript does not support multi-threading because the JavaScript interpreter in the browser is a single thread (AFAIK). Even Google Chrome will not let a single web page's JavaScript run concurrently because this would cause massive concurrency issues in existing web pages. Also we saw that it working as expected using log prints.
1 parent 84390ca commit bb31d07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/rxrpc-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {defer, interval, Observable, of, OperatorFunction, Subject, throwError} from 'rxjs';
2-
import {distinctUntilChanged, finalize, flatMap, refCount, shareReplay, takeUntil, takeWhile} from 'rxjs/operators'
2+
import {distinctUntilChanged, finalize, flatMap, refCount, share, shareReplay, takeUntil, takeWhile} from 'rxjs/operators'
33
import {Response} from './data/response';
44
import {Result} from './data/result';
55
import {Invocation, Invocations} from './data/invocation';
@@ -53,7 +53,7 @@ export class RxRpcClient extends RxRpcInvoker {
5353
() => observer.complete());
5454
}
5555
})
56-
.pipe(shareReplay({bufferSize: 1, refCount: false}))
56+
.pipe(share())
5757
}
5858

5959
public observeConnected(): Observable<boolean> {

0 commit comments

Comments
 (0)