Skip to content

Add delaySubscription(Observable<U>) overload? #3445

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

Closed
JakeWharton opened this issue Oct 14, 2015 · 3 comments
Closed

Add delaySubscription(Observable<U>) overload? #3445

JakeWharton opened this issue Oct 14, 2015 · 3 comments

Comments

@JakeWharton
Copy link
Contributor

Usage of delaySubscription has started popping up in our code base, and I've noticed that we always have to define a Func0 simply to yield an observable that's either cold (in which case the function provides no value) or hot (in which case the function also provides no value). It's not clear to me why the function indirection was added in the first place as it's provided no data and Observable.defer could have served in its place.

I would like to propose adding an Observable-taking overload and replacing the Func0 variant to instead wrap its given argument in Observable.defer before passing to OnSubscribeDelaySubscriptionWithSelector.

Being able to sneak this in before 1.0.15 / 1.1.0 would also be nice 😀

@akarnokd
Copy link
Member

See #3447. I didn't touch the current Func0 variant to avoid introducing unexpected effects to existing code.

@JakeWharton
Copy link
Contributor Author

👍 Thanks @akarnokd!

@akarnokd
Copy link
Member

akarnokd commented Feb 9, 2016

Fix merged.

@akarnokd akarnokd closed this as completed Feb 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants