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(Resolve): prevent RXWAIT from waiting for the observable to complete #2905

Merged
merged 1 commit into from
Aug 2, 2016

Conversation

adharris
Copy link
Contributor

@adharris adharris commented Aug 2, 2016

The RXWAIT resolve policy is supposed to wait for the resolved observable to begin emitting values, and then provide the observable. It accomplishes this by first cache()ing the observable and then waiting on the result of toPromise. However, RxJS toPromise only resolves the promise when the stream completes, not when the first value is emitted as desired. Adding take(1) before toPromise will cause the stream to complete after 1 value is emitted, at what point the original stream can be returned.

Also, the cache() without a buffer size will cause all old results to be replayed to new subscribers. Setting a buffer size of 1 will cause only the most recent emitted value to be replayed.

@christopherthielen christopherthielen merged commit fef9640 into angular-ui:master Aug 2, 2016
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