I am following an Udemy guide and I’ve reached the Firebase chapter. Here I’m being teached to build a chat app. At a point during the course, there’s the concept of unsubscribe being used. In more practical words – the app has about 3 chat rooms and when the user changes from one to another (gets updated in other words), the guide says to unsubscribe for changes. I don’t really understand it or why I should use it. I looked it up on Google but the info was minimal for some reason. Can someone offer me more insight on why/when to unsubscribe in Firebase? Thanks!

Anonymous Asked question May 14, 2021