ngx-auto-unsubscribe icon indicating copy to clipboard operation
ngx-auto-unsubscribe copied to clipboard

Fix ObjectUnsubscribedError

Open mriegr opened this issue 6 years ago • 3 comments

Prevent calling unsubscribe function on RxJs Subject which causes ObjectUnsubscribedError

mriegr avatar Apr 10 '19 06:04 mriegr

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...

jepstein-eagle avatar Oct 04 '19 13:10 jepstein-eagle

@marcelriegr, can you give me an example for this use case, please?

NetanelBasal avatar Oct 04 '19 13:10 NetanelBasal

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

ryaa avatar Dec 04 '19 09:12 ryaa