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
ForkJoin of observables remain cold #617
Comments
Hi, just to confirm this - I ran into a similar problem:
-> my log never triggers Note: PS: I'm doing this inside a Ionic 2 RC1 application
|
@jeffarese @janein I don't belive this is a bug. If you use the The RxJS 5 documentation for
|
Closing due to @cartant's explanation. |
I have tried to use first() in the forkJoin that did not work. Using take(1) did work however. Am I using the code incorrectly? does not work Observable.forkJoin(
this.af.database.list('/rooms').first(1),
this.af.database.list('/devices').first(1)); works Observable.forkJoin(
this.af.database.list('/rooms').take(1),
this.af.database.list('/devices').take(1)); |
@jusefb I believe it should be .first() with no arguments passed. With that being said, in my use case both .first() and take(1) seemed to work equivalently |
@cartant is there a way to have forkJoin emit a new event when the underlying Observables change due to changes to the Firebase database, so that the UI template can update automatically. I place this in the constructor for a component and it fires when the page loads
but if I delete a friend while on the page, Firebase correctly updates, but subscribe doesn't fire again. If I subscribe to something more simple
then changes to Firebase are automatically reflected in my UI |
@afreix No, that's not how It you want an observable that combines the the values and continues to listen, you should use |
Version info
Angular: 2.0.0
Firebase: 3.4.1
AngularFire: 2.0.0-beta.5
Other (e.g. Node, browser, operating system) (if applicable):
Node 6.0.0
Windows 10
Any browser
Steps to reproduce
In any flat database, it's common to have to perform multiple queries to complete the object information.
For example, if I have a
conversation
node with a list ofuserIds
, I would like to perform a query to the nodeusers
to retrieve the user information and then create my customconversation
object with all the data.The problem is that, unlike normal HTTP calls to a REST API, when using a
forkJoin
withFirebaseObjectObservable
orFirebaseListObservable
elements, the resulting Observable of the forkJoin remains cold.Perform any forkjoin of observables, like:
Expected behavior
The expected behavior is that I can subscribe to the resulting
Observable
and do things.Actual behavior
The resulting
Observable
remains cold, it doesn't trigger anything inside thesubscribe
The text was updated successfully, but these errors were encountered: