-
Notifications
You must be signed in to change notification settings - Fork 26.3k
feat(core): Add rxjs operator prevent app stability until an event #56533
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
Conversation
ab923f9
to
623b0d5
Compare
* | ||
* @experimental | ||
*/ | ||
export function pendingUntilEvent<T>(injector?: Injector): MonoTypeOperatorFunction<T> { |
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.
What happens if an app never stabilizes (because of some bug)? This will never complete I guess? Should we offer a timeout for this one, or just document it for the devs to keep that in mind too?
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.
Assuming you mean what happens when no event (emit, error, unsubscribe, or complete) occurs in the subscription? This operator affects stability rather than app stability affecting the task completion.
I don't believe a timeout is something that should be configured in this operator. If a timeout for the task is desirable, that can be done in a different operator, i.e. the builtin timeout.
edit to clarify: Leaving this open because I do think this is a reasonable request and worth considering.
623b0d5
to
56873c1
Compare
56873c1
to
0859006
Compare
0859006
to
d7769f8
Compare
This commit adds an operator to help rxjs observables important for rendering keep the application unstable (and prevent serialization) until there is an event (observable emits, completes, or errors, or the subscription is unsubscribed). This helps with SSR for zoneless and also helps for when operations are intentionally executed outside the Angular Zone but are still important for SSR (i.e. angularfire and the zoneWrap helper hacks).
d7769f8
to
2cd51f7
Compare
I guess it can only happen if the “async” pipe is being used in the template (instead of a signal). Please let me know if I’m wrong. |
Caretaker: PR is "green" in g3. |
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.
Reviewed-for: public-api
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.
Reviewed-for: public-api
This PR was merged into the repository by commit 8ebbae8. The changes were merged into the following branches: main |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit adds an operator to help rxjs observables important for rendering keep the application unstable (and prevent serialization) until there is an event (observable emits, completes, or errors, or the subscription is unsubscribed). This helps with SSR for zoneless and also helps for when operations are intentionally executed outside the Angular Zone but are still important for SSR (i.e. angularfire and the zoneWrap helper hacks).