Skip to content
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

fix: do not use RxJS scheduler since this may flush the queue within the root zone #202

Merged
merged 1 commit into from
Jun 20, 2022

Conversation

arturovt
Copy link
Collaborator

Issue: #199

@arturovt arturovt requested a review from NetanelBasal as a code owner June 20, 2022 23:21
@arturovt arturovt merged commit 03d2604 into master Jun 20, 2022
@arturovt arturovt deleted the fix/199 branch June 20, 2022 23:39
// RxJS schedulers coalesce tasks and then flush the queue, which means our task might be scheduled
// within the root zone, and then all of the tasks (that were set up by developers in the Angular zone)
// will also be flushed in the root zone.
function observeOnPromise<T>() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use mergeMap instead of creating new observable as you're already imported it:

mergeMap((value) => Promise.resolve(value))

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, missed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants