From a02caf34fcc774c56d6f222c8433b70157765c13 Mon Sep 17 00:00:00 2001 From: Andrew Harris Date: Tue, 2 Aug 2016 13:53:24 -0400 Subject: [PATCH] fix(Resolve): prevent RXWAIT from waiting for the observable to complete --- src/resolve/resolvable.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resolve/resolvable.ts b/src/resolve/resolvable.ts index 5e14c44dc..2fc521d21 100644 --- a/src/resolve/resolvable.ts +++ b/src/resolve/resolvable.ts @@ -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 @@ -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.