Skip to content

Commit

Permalink
fix: userRequests$ multicasted with shareReply (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichita-pasecinic authored Feb 8, 2024
1 parent 05576f9 commit 52adc53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clever-panthers-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nichitaa/rxjs-ws": patch
---

user request multicast operator
6 changes: 5 additions & 1 deletion src/core/web-socket-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,11 @@ export class WebSocketConnector {
response: defaultResponse,
};
const $ = new BehaviorSubject<StreamResponse<TRes, TReqOut, TErr>>(uninitializedValue);
const userRequests$ = requests$.pipe(filterNullAndUndefined(), transformRequests);
const userRequests$ = requests$.pipe(
filterNullAndUndefined(),
transformRequests,
shareReplay(1),
);

userRequests$
.pipe(
Expand Down

0 comments on commit 52adc53

Please sign in to comment.