Closed olessavluk closed 5 years ago
Your two$
observable is not equivalent to of
as it doesn't complete. Was the cold observable you replaced with of(1)
similar? That is, did it complete?
Yes, I have tried to make it completed, this didn't helped (updated example repo to include both cases). Take a looks at this two examples:
when using of()
works fine and return [1, 2]
:
const two$ = of(2);
const res$ = of(1).pipe(withLatestFrom(two$));
when using m.cold
it does not return anything:
const two$ = m.cold("(t|)", { t: 2 });
const res$ = of(1).pipe(withLatestFrom(two$));
Is this a bug or a proper behavior?
The behavioural difference will likely be down to your source observable being a synchronous, non-TestScheduler
-managed observable. I suspect if you change your source from of(1)
to be cold("(1|)")
it will be fine. In general, I make sure to use either a cold
or hold
observable as the source.
Hello,
I have the following test (example repo with it https://github.com/olessavluk/rxmarbles-issue/blob/master/src/marble.test.js):
When I use
of(2)
it works fine, but when I usem.cold
result is never returned.Why is that, aren't they supposed to behave in the same way?