Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source for ShareReplay accidentally re-introduced? #710

Closed
larrifax opened this issue Nov 12, 2015 · 7 comments
Closed

Source for ShareReplay accidentally re-introduced? #710

larrifax opened this issue Nov 12, 2015 · 7 comments

Comments

@larrifax
Copy link

I just noticed that the source for shareReplay still exists in src/operators/shareReplay.ts. This was supposed to be removed in d0adf57, wasn't it? e196657 seems to re-introduce it. Maybe a merge gone wrong there?

@staltz
Copy link
Member

staltz commented Nov 12, 2015

Good catch. I'll remove it.

staltz added a commit to staltz/RxJSNext that referenced this issue Nov 12, 2015
Remove two operators that were reintroduced by mistake. shareReplay and shareBehavior should not
exist anymore.

Resolves issue ReactiveX#710.
@kwonoj
Copy link
Member

kwonoj commented Nov 12, 2015

I think this can be closed now. Please freely reopen if there's necessary task remains.

@kwonoj kwonoj closed this as completed Nov 12, 2015
@sbabeal
Copy link

sbabeal commented Feb 18, 2016

Why were this members removed. How to i get the same behaviour with auto connect. I don't have to have to call connect every time I make a subscription because I don't know my callers

@trxcllnt
Copy link
Member

@sbabeal you can achieve the same behavior by calling source.publishReplay().refCount(). The share operators were removed to highlight the fact that the old share operator behaviors don't support retrying or repeating.

@sbabeal
Copy link

sbabeal commented Feb 18, 2016

Let me give it a try. When I moved over to publishReplay(), the code running under the subscription never gets called.

const connectionObservable = rx.Observable.create((observer: rx.Observer) => {
writeToLog("creating new connection for " + url);
const conn = new SignalRConnection(url);
observer.next(conn);
// need to add disconnection logic here.
}).publishReplay(1);

So when I call connectionObservable.subscribe( x => ….) the code in yellow never gets run.

If I remove publishReplay(1). Then it works as expected. My issue is that the next subscriber doesn’t get the SignalRConnection since its was already published.

I’ll write back in a second to let you know if it worked.

-Brandt

From: Paul Taylor [mailto:notifications@github.com]
Sent: Wednesday, February 17, 2016 8:16 PM
To: ReactiveX/RxJS RxJS@noreply.github.com
Cc: Brandt Beal BBeal@slb.com
Subject: Re: [RxJS] Source for ShareReplay accidentally re-introduced? (#710)

@sbabealhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sbabeal&d=CwMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=Mo1qRXShQ_F6v4wFHj1oKQ&m=2dZayngCjjejIGVa2ePfrPr4GtyHbBxx-YPnq9RmsCM&s=DiqmwkTZljba3kMLC5xFRoMswAwuveXdwXPkuM2p-eY&e= you can achieve the same behavior by calling source.publishReplay().refCount(). The share operators were removed to highlight the fact that the old share operator behaviors don't support retrying or repeating.


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ReactiveX_RxJS_issues_710-23issuecomment-2D185510666&d=CwMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=Mo1qRXShQ_F6v4wFHj1oKQ&m=2dZayngCjjejIGVa2ePfrPr4GtyHbBxx-YPnq9RmsCM&s=xaZsdrev_yL4BXa1XzahuvthRKbi10JRjeO3mkQ78NA&e=.

@sbabeal
Copy link

sbabeal commented Feb 18, 2016

Dude you’re awesome!!! Works perfectly. Thanks

-Brandt

From: Paul Taylor [mailto:notifications@github.com]
Sent: Wednesday, February 17, 2016 8:16 PM
To: ReactiveX/RxJS RxJS@noreply.github.com
Cc: Brandt Beal BBeal@slb.com
Subject: Re: [RxJS] Source for ShareReplay accidentally re-introduced? (#710)

@sbabealhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sbabeal&d=CwMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=Mo1qRXShQ_F6v4wFHj1oKQ&m=2dZayngCjjejIGVa2ePfrPr4GtyHbBxx-YPnq9RmsCM&s=DiqmwkTZljba3kMLC5xFRoMswAwuveXdwXPkuM2p-eY&e= you can achieve the same behavior by calling source.publishReplay().refCount(). The share operators were removed to highlight the fact that the old share operator behaviors don't support retrying or repeating.


Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ReactiveX_RxJS_issues_710-23issuecomment-2D185510666&d=CwMCaQ&c=uGuXJ43KPkPWEl2imVFDmZQlhQUET7pVRA2PDIOxgqw&r=Mo1qRXShQ_F6v4wFHj1oKQ&m=2dZayngCjjejIGVa2ePfrPr4GtyHbBxx-YPnq9RmsCM&s=xaZsdrev_yL4BXa1XzahuvthRKbi10JRjeO3mkQ78NA&e=.

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants