Skip to content

Commit a02caf3

Browse files
committed
fix(Resolve): prevent RXWAIT from waiting for the observable to complete
1 parent 0769bc2 commit a02caf3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/resolve/resolvable.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class Resolvable implements ResolvableLiteral {
4646
/** This constructor creates a new Resolvable from the plain old [[ResolvableLiteral]] javascript object */
4747
constructor(resolvable: ResolvableLiteral)
4848

49-
/**
49+
/**
5050
* This constructor creates a new `Resolvable`
5151
*
5252
* @example
@@ -125,8 +125,8 @@ export class Resolvable implements ResolvableLiteral {
125125
* - Waits for the promise, then return the cached observable (not the first emitted value).
126126
*/
127127
const waitForRx = (observable$: any) => {
128-
let cached = observable$.cache();
129-
return cached.toPromise().then(() => cached);
128+
let cached = observable$.cache(1);
129+
return cached.take(1).toPromise().then(() => cached);
130130
};
131131

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

0 commit comments

Comments
 (0)