Skip to content

Commit

Permalink
Merge pull request #2905 from adharris/rxwait-fix
Browse files Browse the repository at this point in the history
fix(Resolve): prevent RXWAIT from waiting for the observable to complete
  • Loading branch information
christopherthielen authored Aug 2, 2016
2 parents 0769bc2 + a02caf3 commit fef9640
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit fef9640

Please sign in to comment.