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

feat(shareReplay): added 'disconnect' feature #4411

Closed
wants to merge 2 commits into from

Conversation

Malvolio
Copy link
Contributor

@Malvolio Malvolio commented Dec 7, 2018

Description:
Updated shareReplay to support 'disconnect'. That is, when the refCount drops to 0, the buffer can (optionally) be dropped, and then, upon the next subscription, re-subscribes to the source.

Rather than adding another parameter, a config-object interface has been added. For compatibility, the old parameters still work, but the disconnect option can only be reached with the config option, so shareReplay(3) is equivalent to shareReplay({ bufferSize: 3}), but you might instead want shareReplay({ bufferSize: 3, disconnect: true}).

Related issue (if exists):

This is in response to issue 3722.

@cartant
Copy link
Collaborator

cartant commented Dec 7, 2018

The problem with shareReplay has been addressed in #4059 - but that PR has not yet been merged.

@Malvolio
Copy link
Contributor Author

Malvolio commented Dec 7, 2018

The problem with shareReplay has been addressed in #4059 - but that PR has not yet been merged.

Haha, I was talking to Ben Lesh and he suggested I make this change. I guess he forgot about that PR.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7820

  • 32 of 32 (100.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.2%) to 97.038%

Files with Coverage Reduction New Missed Lines %
src/internal/observable/fromPromise.ts 1 87.5%
src/internal/observable/fromIterable.ts 2 95.24%
src/internal/observable/fromObservable.ts 2 83.33%
Totals Coverage Status
Change from base Build 7749: 0.2%
Covered Lines: 5799
Relevant Lines: 5976

💛 - Coveralls

@cartant
Copy link
Collaborator

cartant commented Jan 26, 2019

Closing this in favour of #4059

@cartant cartant closed this Jan 26, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Feb 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants