When to use take() vs takeUntilDestroyed()?

  Рет қаралды 3,761

Deborah Kurata

Deborah Kurata

Күн бұрын

Пікірлер: 45
@maneseligaso5754
@maneseligaso5754 2 ай бұрын
Excellent content, Ms. Kurata. For the first time, I found clear explanations about how these operators work. Greetings from Brazil
@deborah_kurata
@deborah_kurata 2 ай бұрын
Glad it was helpful! Thanks for watching!
@albertkao5964
@albertkao5964 4 ай бұрын
Stackblitz is extremely valuable! Cracking open the Angular and RxJS source code are very instructive! Links are useful! The summary at the end are excellent! Thanks!!!!
@deborah_kurata
@deborah_kurata 4 ай бұрын
Great to hear! Thank you so much! 😊
@richarddefortune1329
@richarddefortune1329 4 ай бұрын
Great video, as usually! Looking forward for the ngrx signal store course.
@joeyvico
@joeyvico 4 ай бұрын
Yet another great tutorial. Many thanks Deborah! I would love to have a deep dive tutorial on error handling with the catchError and throwError operators, best practices and such. Thanks again
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you so much! Have you seen this one: kzbin.info/www/bejne/gmrOd4emqMRqis0
@anthonyfreneat6555
@anthonyfreneat6555 4 ай бұрын
The clarity of the explanations was clearly at Chad's level
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thank you! 😊
@chagamajaykumarreddy1897
@chagamajaykumarreddy1897 4 ай бұрын
I am eagerly waiting for your videos always
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thank you! 😊
@ErickRodrCodes
@ErickRodrCodes 4 ай бұрын
This is something I need to show to my team of engineers. take(1) is basically useless. it is always suggested to destroy the HTTP Observable to avoid memory leaks with TakeUntilDestroyed
@AniketDeshbhratar
@AniketDeshbhratar 3 ай бұрын
Beautifully explained
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you so much 🙂
@DanIL_diaries
@DanIL_diaries 4 ай бұрын
Thanks!
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thank you so very much!
@user-shwan
@user-shwan 4 ай бұрын
Thank you so much Deborah for another great thoughtful video!
@deborah_kurata
@deborah_kurata 4 ай бұрын
Glad it was helpful!
@katerynakhokhlova5836
@katerynakhokhlova5836 2 ай бұрын
Would it make sense and align with RxJS best practices to trigger the necessary logic after a PUT/POST/DELETE request in the complete callback? This approach allows us to respond to changes while ensuring that we only update the state of services that still exist, avoiding logic execution for components or services that may have been destroyed. We achieve this by using `takeUntilDestroyed` and splitting the logic into two parts: one for the pipeline and next callbacks execution, and the other for side actions in the complete callback, such as updating state in another service provided at the root level.
@OlehBiblyi
@OlehBiblyi 4 ай бұрын
I've got exactly same question about take(1), and here is another great video.
@deborah_kurata
@deborah_kurata 4 ай бұрын
Glad it was helpful! Thank you!
@CeezGeez
@CeezGeez 4 ай бұрын
ty! your videos are invaluable!
@deborah_kurata
@deborah_kurata 4 ай бұрын
Great to hear! Thank you!
@EmilioDegiovanni
@EmilioDegiovanni 4 ай бұрын
What about using both in case of emits are less than the take(X)? ie: pipe(take(10), takeUntilDestroyed()). Then only happened 5 emits and component is destroyed.
@deborah_kurata
@deborah_kurata 4 ай бұрын
Yes! 😊 That would be good practice for long running Observables, such as a timer.
@fullsquatdev
@fullsquatdev 3 ай бұрын
Great video, keep going
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! 😊
@GaryChike
@GaryChike 4 ай бұрын
Great info!
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thank you!
@mohammadrezamrg9380
@mohammadrezamrg9380 4 ай бұрын
What about Take(1) in http request with options in header? when we have preflight request.
@deborah_kurata
@deborah_kurata 4 ай бұрын
AFAIK, HTTPClient still only emits one time with the response. So they take(1) still won't do anything.
@1frecin
@1frecin 3 ай бұрын
Can I expect some tutorials on creating micro frontends in angular?
@deborah_kurata
@deborah_kurata 3 ай бұрын
Probably not ... but this may help: nx.dev/concepts/module-federation/micro-frontend-architecture
@marshallgraphic
@marshallgraphic 4 ай бұрын
Do you mean destroying an observable when using the HttpClient POST, PUT, or DELETE operations is unnecessary?
@deborah_kurata
@deborah_kurata 4 ай бұрын
If you look at the reasons it is so important to unsubscribe from an Observable: - Prevent memory leaks -> HTTP requests are one and done so won't leak memory (unlike timers or Subjects) - Cancel the request if navigating away -> Users most likely don't want their save requests cancelled. If they clicked a Save button and left a feature, they still want the save operation to complete. So, yes!
@marshallgraphic
@marshallgraphic 4 ай бұрын
@@deborah_kurata Thank you for that :)
@rs4267
@rs4267 4 ай бұрын
😊 thanks for this video
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thanks for watching! 😊
@chellaack1644
@chellaack1644 4 ай бұрын
Thank awesome
@deborah_kurata
@deborah_kurata 4 ай бұрын
Thank you!
@chellaack1644
@chellaack1644 4 ай бұрын
@@deborah_kurata can you please post a video of memoized selector of ngrx ,I expecting and awaiting for long time
@deborah_kurata
@deborah_kurata 4 ай бұрын
Great topic! I haven't worked with NgRx for a while, so my NgRx skills/knowledge is old and rusted. I have been considering getting back into it and covering some content, especially around signalStore. But looking at my current workload, I doubt I'd have time to look into it until late this year or early next year. So please don't wait for me on that topic. In the mean time, does anything here help? ngrx.io/guide/store/selectors Is there a non-NgRx topic you'd like to see?
@chellaack1644
@chellaack1644 4 ай бұрын
@@deborah_kurata Thanks
@IvanIsmailov-hv9cg
@IvanIsmailov-hv9cg 4 ай бұрын
Hey Deborah Kurata! You doing amazing job! You don’t have any courses in Udemy? I believe if you do courses there, you can find a lot of students who are willing to pay for your courses. 😊
@deborah_kurata
@deborah_kurata 3 ай бұрын
Thank you! I tried to get set up with Udemy, but I was never able to get it to verify my identity. I tried to find somewhere to contact a person, but had no luck, so gave up on it.
Use takeUntilDestroyed to Unsubscribe from Angular's Observables
10:36
Жездуха 42-серия
29:26
Million Show
Рет қаралды 2,6 МЛН
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 106 М.
First Look at Angular's new resource() and rxResource()
11:38
Deborah Kurata
Рет қаралды 9 М.
Google AI Studio Just Blew My Mind! 3 Insanely Cool Uses You NEED to Try!
8:06
Tech_sis | Oluwatosin
Рет қаралды 1,9 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 850 М.
Pitfalls Of Using takeUntil and takeUntilDestroyed RxJS Operators
10:04
Decoded Frontend
Рет қаралды 22 М.
Currying for More Generalized Angular Code
12:41
Deborah Kurata
Рет қаралды 6 М.
ShareReplay in RxJS - Hidden Pitfall You Have To Know (Advanced)
19:17
Decoded Frontend
Рет қаралды 11 М.
5 deadly Rust anti-patterns to avoid
13:25
Let's Get Rusty
Рет қаралды 39 М.
I tried 8 different Postgres ORMs
9:46
Beyond Fireship
Рет қаралды 446 М.