-
Notifications
You must be signed in to change notification settings - Fork 213
UntilDestroyed not working #577
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I had the same problem on an app after migrating to Angular 9 (if I am not mistaken). |
I think the workaround is to add the dependency to this plugin and to not use the until-destroy in the package for moment. |
@luiza-cicone when I wrote the initial version of untilDestroyed, the available version of until-destroy package has some issues, and it fell dumb to add a dependency for a few lines of codes. But it seems that it's now more complex than that with the new Ivy engine, so it's time to migrate and use the better version 👍 |
# [9.2.0](9.1.0...9.2.0) (2021-01-14) ### Bug Fixes * app not loading with Electron v11 ([1444bf0](1444bf0)) * incorrect hads version ([ba20ff1](ba20ff1)) * rename env script to fix execution in some environments (closes [#575](#575)) ([ec93fdb](ec93fdb)) * update electron templates ([3433465](3433465)) * update generator dependencies ([bda29d9](bda29d9)) * update jest config ([4b4a357](4b4a357)) * update packages and fix peer dependencies ([64098dc](64098dc)) * update RouteReusableStrategy for Angular 11 ([#576](#576)) ([3077f5b](3077f5b)) ### Features * add brazilian portuguese language ([1a6d728](1a6d728)) * enable webpack 5 ([8592a71](8592a71)) * migrate to @ngneat/until-destroy (fix [#577](#577)) ([3a77fcb](3a77fcb)) * update editorconfig (fixes [#580](#580)) ([9f036b3](9f036b3))
🎉 This issue has been resolved in version 9.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
I'm submitting a...
Current behavior
The UntilDestroyed on Observable is not working. In the ngOnDestroy(), the method is not called correctly.
Expected behavior
The observable must be "destroyed" when ngOnDestroy is automatically called.
Minimal reproduction of the problem with instructions
ngOnInit(): void { let number = Math.floor(Math.random() * 100); // Init scheduled calls to operation statuses interval(5 * 1000) .pipe(startWith(0)) .pipe(untilDestroyed(this)) .subscribe(() => { console.log('test', number); }); }
ngOnDestroy(): void {
console.log('destroyed');
}
The 'destroyed' log is correctly displayed but the observable still exists.
Environment
Others:
The text was updated successfully, but these errors were encountered: