Can't use `realtime-listener` on 2 attributes
See original GitHub issueSo I’ve been trying to use the realtime-listener
despite the complete lack of instructions. It works okay.
In my component, in the didReceiveAttrs
method, I’m doing the following:
this.get('realtime').subscribe(this, this.get('user'));
Then in the willDestroyElement
I do:
this.get('realtime').unsubscribe(this);
Now the user would be dynamically updated. But if I add an additional subscription in my didReceiveAttrs
method, like this:
this.get('realtime').subscribe(this, this.get('user'));
this.get('realtime').subscribe(this, this.get('post'));
Then the user is not synchronized anymore.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Firestore - React JS realtime listener of a collection
This is the expected behavior. Since data is loaded from Firestore asynchronously, all code that needs the data needs to be inside the ......
Read more >Firebase Firestore Tutorial #8 - Real-time Data - YouTube
Hey gang, in this Firestore tutorial I'll show you how to use the Firstore's real-time capabilities ... Your browser can't play this video....
Read more >CTGDJB - IBM
The tdisrvctl command was unable to connect to the Tombstone manager in the remote server. ... Use keyword 'all' or specify a set...
Read more >Read and Write Data on Android | Firebase Realtime Database
This document covers the basics of reading and writing Firebase data. Firebase data is written to a FirebaseDatabase reference and retrieved by attaching...
Read more >How to set Solace properties with Boomi?
I want to set properties in a Boomi process like ... but setting Solace properties using the JMS custom property feature doesn't work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @jamesdaniels, hope you had a good 5-months holidays. When can we expect some news on this? It’s been 18 months since this package is broken and no one can actually use this properly.
Make Firebase great again.
I worked through this problem, by updating the
realtime-listener
service and therealtime-route
mixin. The update adds asubscriptionId
attribute for tracking subscriptions, rather than relying onaRouteInstance.toString()
as the key. ThesubscriptionId
attribute is generated in a similar fashion; but rather than using a route instance to generate a key, the actualRecordArray
orModel
produced by a query is used to generate they key. This approach provides a more specific way to identify subscriptions and only changes the way subscriptions are identified.RealtimeRoute Mixin Update
This update to the mixin creates a subscriptionId for and from each model. It supports using RSVP.hash to manage multiple queries in a route’s model. Each model in the RSVP.hash is subscribed to, and unsubscribed from, realtime updates during the route’s lifecycle. The mixin also serves as an example for managing subscriptions from a component if preferred. The subscriptionId is generated in the mixin since the model may be destoryed before an unsubscribe is complete. This Mixin requires the update to the realtime-listner shown in the next section.
app/mixins/realtime-route.js
RealtimeListener Service Update
setRouterSubscription
has been changed tosetSubscription
, and asubscriptionId
has been added to support multiple subscriptions from route/component/service.node_modules/emberfire/addon/services/realtime-listener.js