{"id":882,"date":"2023-04-28T05:00:00","date_gmt":"2023-04-28T12:00:00","guid":{"rendered":"https:\/\/www.angulartraining.com\/daily-newsletter\/?p=882"},"modified":"2023-05-12T15:02:35","modified_gmt":"2023-05-12T22:02:35","slug":"angular-16-preview-takeuntildestroyed","status":"publish","type":"post","link":"https:\/\/www.angulartraining.com\/daily-newsletter\/angular-16-preview-takeuntildestroyed\/","title":{"rendered":"Angular 16 Preview: TakeUntilDestroyed"},"content":{"rendered":"\n<p>Angular 16 will be released next week, and this new version will be big. I will cover most of the new features of Angular 16 for the next few days.<\/p>\n\n\n\n<p>One of the simple but handy features shipped with Angular 16 is a new <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/category\/rxjs\/\" target=\"_blank\" rel=\"noopener\" title=\"\">operator for RxJs Observables<\/a>: <code>takeUntilDestroyed<\/code>.<\/p>\n\n\n\n<p>We have covered several techniques to <a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/how-to-avoid-memory-leaks-with-rxjs-observables\/\" target=\"_blank\" rel=\"noopener\" title=\"\">automatically unsubscribe from Observables<\/a> in this newsletter.<\/p>\n\n\n\n<p><code><a href=\"https:\/\/github.com\/angular\/angular\/discussions\/49681#:~:text=of%20signal%20updates.-,takeUntilDestroyed,-Angular%20users%20often\" target=\"_blank\" rel=\"noopener\" title=\"\">takeUntilDestroyed<\/a><\/code> will make all of it easier than ever:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"54\" src=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/04\/image-52.png\" alt=\"\" class=\"wp-image-883\" srcset=\"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/04\/image-52.png 538w, https:\/\/www.angulartraining.com\/daily-newsletter\/wp-content\/uploads\/2023\/04\/image-52-300x30.png 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure>\n<\/div>\n\n\n<p><\/p>\n\n\n\n<p>And that&#8217;s it! That one operator will take care of automatically unsubscribing from <code>data$<\/code> when the component\/pipe\/directive using it is destroyed.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.angulartraining.com\/daily-newsletter\/angular-signals-are-in-the-works\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Signals<\/a> will be the most significant addition to Angular 16 (as a developer preview &#8211; for now), and as a result, I&#8217;m about to launch a short course on Signals. If you&#8217;re interested in beta-testing that course (for free!), please respond to this email to let me know. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Angular 16 will be released next week, and this new version will be big. I will cover most of the new features of Angular 16 for the next few days. One of the simple but handy features shipped with Angular 16 is a new operator for RxJs Observables: takeUntilDestroyed. We have covered several techniques to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,12],"tags":[],"class_list":["post-882","post","type-post","status-publish","format-standard","hentry","category-angular","category-operators"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/882","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/comments?post=882"}],"version-history":[{"count":3,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/882\/revisions"}],"predecessor-version":[{"id":952,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/posts\/882\/revisions\/952"}],"wp:attachment":[{"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/media?parent=882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/categories?post=882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.angulartraining.com\/daily-newsletter\/wp-json\/wp\/v2\/tags?post=882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}