-
Notifications
You must be signed in to change notification settings - Fork 971
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
Type-safe initial value skipping? #153
Comments
I know we talked about this a long time ago. I've had a bit of a change of heart on it. It would be nice to indicate somehow that the Observable is expected to emit an initial value. I wonder how the folks at RxJava think about it... My only concern is that this wouldn't be enough, since you can still use an |
I think this can be viewed as an advantage, but I understand the sentiment.
I believe my initial proposal was opting in to the initial emission. I don't necessarily think that is the right approach either, but it certainly would be explicit. |
I think I'm going to make the above proposed change before 0.3 unless there's any compelling argument towards an opt-in approach. In a casual glance through our codebase, we opt-out far less than we allow the initial value emission. That's just one example of tens of uses. I'm also not confident that I checked every operator that does have an initial value. |
I think that the cleanest and the simplest way is to use naming conventions.
|
Those overloads would just be implemented using a mechanism like what was On Sat, Oct 17, 2015, 10:48 AM Konstantin Mikheev notifications@github.com
|
Punting on this to 2.0 after spending the night prototyping different approaches. |
I just wonder: what do you think about |
We've seen and heard struggles with the initial value behavior. Some observables emit it (property-based ones) and others do not (event-based ones).
It would be nice to encapsulate this in the type system for guarantees beyond just Javadoc.
Consumers could then rely on the type system for guaranteeing both that the observable would emit an initial value and that they could skip it.
The text was updated successfully, but these errors were encountered: