Closed Jopie64 closed 3 years ago
Great catch! Apparently, I didn't think of such case!
AFAIK, this is the current behavior. So, I guess, we'll mark this issue as documentation-related and we gotta keep this in mind with #10
Sounds good?
UPD: had this issue opened before you referenced it in those commits, didn't saw them š
Current behavior is option 4: It waits indefinitely for a value of o1
and doesn't do anything when it receives one :D
So I think it needs fixing.
š©! That needs fixing š
Description
Before I forget, here my proposal for the case that an untracked observable doesn't immediately (synchronously) emit.
In the code there is a place where a decision should still be made:
I'd propose to go for the first. I think the spec would be something like: an observable is always tracked before it emits its first value. Only then it will be tracked when resolved with
$
.Rationale
Consider this scenario:
If we do the second, this resulting expression will complete without emitting when
o1
doesn't immediately emit. If we do the third, then a user should always check untracked observable values for undefined.In case we do the first, it will wait for a value of
o1
, then subscribeo2
and start to emit values whenevero2
emits. This IMHO is the best solution.Let me know what you think. Could you think of a scenario where the first solution would do something inconsistent?