ngx-auto-unsubscribe
ngx-auto-unsubscribe copied to clipboard
Fix ObjectUnsubscribedError
Prevent calling unsubscribe function on RxJs Subject which causes ObjectUnsubscribedError
Great idea to catch this case!
Is this possible without importing rxjs as a dependency? It would be awesome to avoid increasing the bundle size for downstream consumers who do not use rxjs...
@marcelriegr, can you give me an example for this use case, please?
See https://stackblitz.com/edit/angular-route-navigate-acifsw
The problem is that sometimes (and this is intermittent!) the componentDestroyed.next() in ngOnDestroy is invoked after ngx-auto-unsubscribe unsubscribes therefore there will be an error ObjectUnsubscribedError