-
-
Notifications
You must be signed in to change notification settings - Fork 204
refactor: drop publish
, publishReplay
, and ConnectableObservable
#1638
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
base: main
Are you sure you want to change the base?
Conversation
@@ -74,7 +74,7 @@ export class RxEffects implements OnDestroy, OnDestroy$ { | ||
private static nextId = 0; | ||
readonly _hooks$ = new Subject<DestroyProp>(); | ||
private readonly observables$ = new Subject<Observable<unknown>>(); | ||
// we have to use publish here to make it hot (composition happens without subscriber) | ||
// we have to use share here to make it hot (composition happens without subscriber) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment even true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it's not... https://stackblitz.com/edit/rxjs-nwerqp?file=index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably it is meant in a different way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why it is not true? share
will multicast the stream (hot), so the computation is only made once even if there are multiple subscribers. Here is an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
composition happens without subscriber
is not true for share
, only for connectable
after calling the connect
method :)
TODO: check RxJS version compatibility |
@edbzn this def. changes our minimum rxjs requirement. |
publish
,publishReplay
, andConnectableObservable
are deprecated in RxJS v7 and removed in upcoming v8.