Replies: 2 comments 1 reply
-
|
I would suggest flattening this out with async/await |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Well you use the onSnapshot method on a Reference where you use a where method with a provided Id, so it will be nested. Hope it helps =) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm struggling to overcome problems that I have on nested
onSnapshot, so, in short, I have 3 nestedonSnapshotand when parent/rootonSnapshotupdates it also creates newonSnapshotlisteners and leaves old ones too, so old and new ones are listening to the changes. I know that I should unsubscribe it but I can't, I'm losing track of which listeners are added or already exist.One solution is to create array of unsubscribing functions in parent
onSnapshot, but there another problem comes, I'm usingdocChangeswithforEachand it is hard to manage which would I unsubscribe from array.I saw this on Stackoverflow but it doesn't fit mine or even doesn't explain correctly exactly this case: nested listeners
What can you suggest to me? I don't know what else should I do.
Thanks in advance.
here is an example of my code that I'm trying to implement unsubscribe stuff( I use Mobx):
Beta Was this translation helpful? Give feedback.
All reactions