Thank you Deborah. When you have time please do a video for 2 dependent dropdowns using rxjs, like country for the first and capitals the second dropdown. All the best
Thank you for creating and sharing such amazing content! Your clear and easy-to-understand explanations, even for complex concepts, are incredibly valuable and helpful. Keep up the fantastic work! 😊
Proud to watch this as the first person, I have a question how should one handle a case of "update list of users when backend updates them" must one use something like firebase fcm or can RxJs come to the rescue?
😊 RxJS out of the box doesn't have features to support real-time messaging. SignalR, which uses WebSocket, is an option that returns an observable. Or you can use WebSocket directly. It looks like FCM may also support this scenario. I've not ever had this requirement in the applications I've built, so I don't have any experience with any of these options.
@@deborah_kurata thank you :) maybe a broad question but couldn’t we just use this for every single observable we need to subscribe to manually from now on? Or are there occasions where using takeUntilDestroyed is not ideal?
@@CodingAbroad In my coding, I try to use toSignal whenever I can. Then the takeUntilDestroyed isn't needed. But if I can't use toSignal and have to manually subscribe, then I go with takeUntilDestroyed.
@@deborah_kurata ah just seen your recent toSignal video to understand it better - thanks very helpful. Is it best practise to leave observables that are started using the template async pipe like this? advertisers$ = this.httpService.getCombinedData(); @if ((advertisers$ | async); as searchData) { } Or is there some signals magic I should be doing here too? I just want to list data out read only in this circumstance
What you have still works. And at least as of now, there are no plans to deprecate the async pipe. But the Angular team is pushing forward with signals as the primary mechanism for displaying data from a component. At some future point, you could modify that observable (advertisers$) to a signal using `toSignal()`. Then display the signal in the template without the async pipe. advertisers = toSignal(this.httpService.getCombinedData()); @if (advertisers; as searchData) { } And you may not need the `as` clause, but it is still supported with signals.
Hey Deborah, great content always. I have question here ! So what happens with CatchError returning EMPTY? Should I put takeUntilDestroyed before or after? I guess I didn't totally understand how teardown logic works.
Thank you! Yes, you could modify the setError method to return EMPTY. You'd then want to change the code a bit because if there isn't a set of todos returned (even an empty set of todos), the current code implementation won't turn off the loading flag. I guess that provides an example of how being lazy (and not separately setting the loading flag off), can cause issues down the road. 😊 Regarding if it should be before or after takeUntilDestroyed ... in our example we use a switchMap and add the catchError in it's pipeline. That is the recommended approach.
Always killing the game. Thanks for another great video.
Thank you so much!
Thank you Deborah. When you have time please do a video for 2 dependent dropdowns using rxjs, like country for the first and capitals the second dropdown. All the best
Thank you!
Great suggestion! I'll add it to my list.
Thank you for creating and sharing such amazing content! Your clear and easy-to-understand explanations, even for complex concepts, are incredibly valuable and helpful. Keep up the fantastic work! 😊
Wow! Thank you so much! 😊
Proud to watch this as the first person,
I have a question how should one handle a case of "update list of users when backend updates them" must one use something like firebase fcm or can RxJs come to the rescue?
😊
RxJS out of the box doesn't have features to support real-time messaging. SignalR, which uses WebSocket, is an option that returns an observable. Or you can use WebSocket directly. It looks like FCM may also support this scenario.
I've not ever had this requirement in the applications I've built, so I don't have any experience with any of these options.
Very helpful! Thanks.
Great to hear! 😊
So I guess we can replace the normal takeUntil with takeUntilDestroyed?
Yep.
@@deborah_kurata thank you :) maybe a broad question but couldn’t we just use this for every single observable we need to subscribe to manually from now on? Or are there occasions where using takeUntilDestroyed is not ideal?
@@CodingAbroad In my coding, I try to use toSignal whenever I can. Then the takeUntilDestroyed isn't needed. But if I can't use toSignal and have to manually subscribe, then I go with takeUntilDestroyed.
@@deborah_kurata ah just seen your recent toSignal video to understand it better - thanks very helpful.
Is it best practise to leave observables that are started using the template async pipe like this?
advertisers$ = this.httpService.getCombinedData();
@if ((advertisers$ | async); as searchData) {
}
Or is there some signals magic I should be doing here too? I just want to list data out read only in this circumstance
What you have still works. And at least as of now, there are no plans to deprecate the async pipe.
But the Angular team is pushing forward with signals as the primary mechanism for displaying data from a component.
At some future point, you could modify that observable (advertisers$) to a signal using `toSignal()`. Then display the signal in the template without the async pipe.
advertisers = toSignal(this.httpService.getCombinedData());
@if (advertisers; as searchData) {
}
And you may not need the `as` clause, but it is still supported with signals.
Missed an opportunity to add "Unless it's my channel" to rule 1
😄
perfect, thats what i need! :)
Great!
Hey Deborah, great content always. I have question here ! So what happens with CatchError returning EMPTY? Should I put takeUntilDestroyed before or after? I guess I didn't totally understand how teardown logic works.
Thank you!
Yes, you could modify the setError method to return EMPTY. You'd then want to change the code a bit because if there isn't a set of todos returned (even an empty set of todos), the current code implementation won't turn off the loading flag. I guess that provides an example of how being lazy (and not separately setting the loading flag off), can cause issues down the road. 😊
Regarding if it should be before or after takeUntilDestroyed ... in our example we use a switchMap and add the catchError in it's pipeline. That is the recommended approach.
Great video as usually.
Thanks!