-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Too many sharing operators? Should we cull the herd? #298
Comments
I'd also appreciate the thoughts of @mattpodwysocki, who undoubtedly has faced more internal client needs (or dislikes) for the presence of these operators. |
I agree with the sentiment there are too many of them (I know I added yet more, but that was in an attempt to standardize them). I have also been teaching these operators to developers, and they mostly prefer Agreed that The least useful of them all is I would consider this solved if we didn't have use cases for explicit Here are three different courses of action I have in mind: (1) Only share
(2) publish + connect strategies
(3) keep them in the library, but not include them in the global output |
+1 JH
|
@Blesh I almost never Ironically, even though it's counter to our performance goals, I think the best way to reduce operator count is operator overloading/polymorphic functions. |
@trxcllnt That sentence confused me. Can you clarify? You want all of the publish variants? Are you saying you actually use I am in favor of a combination of 1 and 3 in @staltz's comment above. including the share variants and basic building blocks in the exported global, but leaving all of the other ones in the repository. |
The ones that have confused me the most (from a n00b perspective) are the ones that require double chaining like I'm all for leaving the bulk of the operators out of the exported global, but one thing I'd like to see documented / discussed is what the preferred method is for adding your own operators (as a consumer of the library, or in a framework that leverages Rx internally) - i'll open another issue for this? |
@Blesh yes, I almost always |
To be clear I'm fine getting rid of all the specialization of |
I think we have a consensus, then. Your |
Add shareReplay() as a core operator. Vaguely relates to issue ReactiveX#439 and issue ReactiveX#298.
Add shareReplay() as a core operator. Vaguely relates to issue ReactiveX#439 and issue ReactiveX#298.
I think for now, this has been addressed. |
In a hallway discussion with @jhusain, we were talking about how most of the time people really just want
share
orshareReplay
orshareBehavior
(or the like), and rarely do they actually want to justpublish
something without that immediaterefCount
call.Some of these operators are yet to implement, but the list is considerable when you realize they're all specializations of the same thing:
publish().refCount()
publishReplay().refCount()
publishBehavior().refCount()
publishValue().refCount()
share()
shareReplay()
shareBehavior()
multicast(subjectFactory).refCount()
publish()
thenconnect()
publishReplay()
thenconnect()
publishBehavior()
thenconnect()
multicast(subjectFactory)
thenconnect()
publish().connectionStrategyThing
- (tbd @trxcllnt proposed operator for defining connection and disconnection strategy)The problems
My pitch
I think we should pare this back to being a refined set of operators that falls into two categories:
share
rather thanpublish().refCount()
for example)multicast
andrefCount
for exampleTo cull or simply exclude?
An alternative to cutting them completely from the library is to keep them in the library, but not include them in the global output. People could simply use them from their modules.
attn @staltz who was a big proponent of
publishBehavior
(which is honestly one I'd consider cutting in favor ofshareBehavior
)The text was updated successfully, but these errors were encountered: