If an observable completes, do I still have to unsubscribe / dispose (in RxJS) the observable to remove the Observer (prevent memory leaks) or is this handled internally by Rxjs once a onComplete or onError event occurs?
            Asked
            
        
        
            Active
            
        
            Viewed 1,017 times
        
    1 Answers
5
            
            
        No, you don't need to unsubscribe from an observable you know has completed.
If you look at the source code of the RxJS toPromise() function, you'll see a subscribe, but no unsubscribe. That's because it is not necessary, you know the observable is completed.
 
    
    
        edwin
        
- 2,643
- 20
- 17
