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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/resolve/resolvable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class Resolvable implements ResolvableLiteral {
/** This constructor creates a new Resolvable from the plain old [[ResolvableLiteral]] javascript object */
constructor(resolvable: ResolvableLiteral)

/**
/**
* This constructor creates a new `Resolvable`
*
* @example
Expand Down Expand Up @@ -125,8 +125,8 @@ export class Resolvable implements ResolvableLiteral {
* - Waits for the promise, then return the cached observable (not the first emitted value).
*/
const waitForRx = (observable$: any) => {
let cached = observable$.cache();
return cached.toPromise().then(() => cached);
let cached = observable$.cache(1);
return cached.take(1).toPromise().then(() => cached);
};

// If the resolve policy is RXWAIT, wait for the observable to emit something. otherwise pass through.
Expand Down