-
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
Incorrect documentation about operator share
.
#2937
Comments
Yup... you're right. That is a miss on the docs. cc/ @ladyleet |
I wanted to fix this but it seems that this is already (partly) addressed in https://github.com/ReactiveX/rxjs/blob/master/src/operator/share.ts but that is a different file ( @benlesh @ladyleet which of those paths should be the one containing the documentation of the operator? |
As suggested by ReactiveX#2937 this updates the docs on the share operator to better reflect it's actual behaviour.
As suggested by ReactiveX#2937 this updates the docs on the share operator to better reflect it's actual behaviour.
Done with PR #2990 |
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. |
RxJS version:
5.4.3
Expected behavior:
The documentation of
share
should be correct.Actual behavior:
The doc https://github.com/reactivex/rxjs/blob/master/src/operators/share.ts#L16 reads
This is not correct. The operator
share
is actually a alias for.multicast(() => new Subject()).refCount()
. There is difference between these two definition.For
.publish().refCount()
, subscription after source completion will not re-execute the pipeline. However, forshare()
, subscription after source completion do re-execute the pipeline.Check below example
Output of above code is:
And for share:
Above code has below output:
The text was updated successfully, but these errors were encountered: