-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new BehaviorSubject().filter(...).getValue()
not working?
#2378
Comments
I don't think it's I'd assume it's For discussions of extending observable in general, you can refer #1876 / #1829 . |
we could implement |
@kwonoj yes, filter was just the example operator, I'm not quite into the terminology yet. I'll look at the links for extending, thanks. @trxcllnt as a newbie I cannot make specific suggestions as to how this matches the FRP paradigm, but I can say that my greatest frustration so far is how streams change by applying operators; what I get back at the end is often not what I expect. Then it's either a bug or a feature, which takes time to figure out (due to fragmented documentation, but that's another issue). |
Ok, I need to reopen this one due to this:
which prints
The bare
and of course prints
I think either you have to explicitly add a recipe for handling these extremely normal cases very early in the documentation (@kwonoj's links above is way above my level, and beyond my interest), or you have to take a hint from @trxcllnt. Edit: I'm having some really strange inconsistencies in my code here, so the problem might be me... |
Why can't you just save the reference to the original const subject$ = new Rx.BehaviorSubject();
const nextPageToken$ = subject$
.startWith('')
.filter(x => x || x == '')
console.log(log("subject$.next", subject$.next) |
Hmm. I'm returning the subject from a wrapper function, and need both the result stream and the source stream's next method. I could of course code my way out of that, but that shouldn't be necessary imho, as it impacts testability as well as modularity... |
We originally did compose Subject bi-directionality through lift, so if you called |
@gnimmelf for what it's worth, |
@trxcllnt thanks for the replies. I'll manage with it 'as-is', one way or another. =) Just out of curiosity on the note on the original bi-directonal composition: why would it also If only I could do s.th like this:
Cheers! |
I can do this?
and get away with it? -Seems to work... |
Another "case":
Becomes
...at least I'm seeing a pattern. And when I look (again, more thouroughly) at the documentation, most operators return Thanks & feel free to close this issue. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
RxJS version: 5.1.1 on Node v7.5.0
Code to reproduce:
Expected behavior:
console.log(s2.value, s2.getValue)
should print1, [Function]
Actual behavior:
console.log(s2.value, s2.getValue)
printsundefined, undefined
Additional information:
Running this through
babel-preset-es2015-node6
.This works however:
so problem might be my understanding of how this is supposed to work. I'm learning.
Cheers!
The text was updated successfully, but these errors were encountered: