shareReplay with local reference #6404
steven-rothwell
started this conversation in
Ideas / Feature request
Replies: 1 comment 2 replies
-
In version 7, rxjs/src/internal/operators/shareReplay.ts Lines 137 to 142 in cfd2c16 So you can do something similar, but could return some subject - from the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It would be nice to be able to pipe in a shareReplay(this.myReplaySubject), where this.myReplaySubject is a property of the class. Let's say you have an http GET call that gets items and you utilize shareReplay. You also have an http POST that posts one item. After the successful post, it would be nice to call this.myReplaySubject.next([...this.items, item]). It would then alert all who are subscribed to the GET of the new array of items.
I know there is a way of doing this: https://stackoverflow.com/a/67508863/787958, but there is a major flaw in this and that is you can't pass parameters to the GET call.
It would be nice to be able to share and update the subscribers are changes in the service layer.
Beta Was this translation helpful? Give feedback.
All reactions