"how to remove firebase database listener when ref path is no longer available" Code Answer

2

you'll need to retain the path on which you've attached the listener so that you can call off() on it. one way to do this would be:

muserref = firebase.database().ref('users/'+uid+'/items');
muserref.on('value', function(snapshot){
    ....
})

and then later:

muserref.off('value');
By Stephen B. on January 11 2022

Answers related to “how to remove firebase database listener when ref path is no longer available”

Only authorized users can answer the Search term. Please sign in first, or register a free account.