I have an Observable (lets call it myob$) which emits values like this:
----- null ----- 1 ----------- 5 ---->
If i do:
myob$.subscribe(x => console.log(x))
the output is ----- null ----- 1 ----------- 5 ---->
Can I add a pipe so it does not emit until the value from myob$ is not null?
something like:
myob$.pipe(x => ignoreEverytingUntilXIsNotNull).subscribe(x => console.log(x))
So that the output is --------------- 1 ----------- 5 ---->
Thanks in advance
bah I'm thick, I think you just need to do:
myob$.filter(x => !!x).subscribe(x => console.log(x))
assuming no 0's are being emitted :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With