ngneat / until-destroy

🦊 RxJS operator that unsubscribe from observables on destroy
https://netbasal.com/
MIT License
1.74k stars 100 forks source link

unsubscribed checker breaks change detection #199

Closed dzonatan closed 2 years ago

dzonatan commented 2 years ago

This was giving me some headache to find.. I still don't know the actual root cause but it seems that setupSubjectUnsubscribedChecker somehow breaks the CD flow. Of course, this happens only in dev mode as the checker is skipped in production.

https://stackblitz.com/edit/angular-ivy-zpbzzg?file=src/app/movies.component.ts When going back from details -> movies route the view does not get updated with the result that's coming within asapScheduler: image The code should be pretty self-explanatory.

My use case of asapScheduler is actually coming from the https://ngrx.io/guide/component-store/read#debounce-selectors which is used internally.

Obviously, v9.1.1 doesn't have this problem as this checker was introduced in the last version.

arturovt commented 2 years ago

Thank you for the issue! That's an edge case I would never think of.

I've published 9.2.1 with a fix.