An actual interview question. Many thanks for sharing
@MonsterlessonsAcademy Жыл бұрын
Glad you enjoyed it!
@nnikchikvaidze Жыл бұрын
Greetings from country of Georgia, well done! always watching your videos, thank you for good content ! 😊
@MonsterlessonsAcademy Жыл бұрын
Thanks for watching!
@StasSorochan Жыл бұрын
In my stege period they put me in project on Angular. I started to learn it from zero because i have studied React before. Your video helps me understand some things. Thank you. Also i saw what you use vim, so i decided to touch nvim and then it's away we go, nvchad, plugins, lsp and it's been like that for a month now.
@MonsterlessonsAcademy Жыл бұрын
That's great!
@val-do Жыл бұрын
Greetings from Georgia 🇬🇪
@MonsterlessonsAcademy Жыл бұрын
Hi from Germany
@Z3rgatul Жыл бұрын
Thanks, this is really confusing for new ppl in angular like me. Now I see advantages for stateless pages, need to learn it more to see advantages for stateful pages.
@MonsterlessonsAcademy Жыл бұрын
Glad it was helpful!
@Vaivis2 ай бұрын
Thank you
@MonsterlessonsAcademy2 ай бұрын
You're welcome
@Georgii1212 Жыл бұрын
Hello! Thanks a lot for the tutorial! Can you please give a bit more details about the last difference you mention : errors. I thought that there was a catch block for errors, in promises ...?
@MonsterlessonsAcademy Жыл бұрын
It's not really a difference. You get errors in catch for promise and you pack either catchError function in observable or you handle an error inside subscription
@tobalhenriquez823311 ай бұрын
You are the best.
@MonsterlessonsAcademy11 ай бұрын
Thanks!
@jluisOlivares Жыл бұрын
Hi, would you please make a video about the new angular signals sharing data between components? Thanks in advance.
@MonsterlessonsAcademy Жыл бұрын
Hi, thank you for the idea. I have a plan for such video.
@chrisb3902 Жыл бұрын
Great explanation and video!
@MonsterlessonsAcademy Жыл бұрын
Glad you liked it!
@aleksandr95 Жыл бұрын
Thx for helpful video 😊
@MonsterlessonsAcademy Жыл бұрын
My pleasure 😊
@naylagomes1212 Жыл бұрын
aren't promises better for cases where one action needs to wait for another to finish? for example, I have method A and B, method A needs to wait for the request inside method B to finish I particularly don't like using subscribe on occasions like this, as it makes me put method A inside method B's subscribe so I can wait for it to finish, and sometimes that's not my goal
@MonsterlessonsAcademy Жыл бұрын
No. I don't see any cases where promises are better than rxjs except of the reason that they are available without libs and by using fetch you get promises. In RxJS you have concat map where second observable waits for first observable. result$ = foo$.concatMap(fooRes => getBarData(fooRes)) No subscribes needed
@Z3rgatul Жыл бұрын
Sorry, I started refactoring promises into observables and quickly realized how wacky my code becomes. Just basic example, http request, get response, if one of parameters equals to something, i need to get another http request, get response, and do some filtering with first response. example async loadData(param1, param2) { let data1 = await service.getData1(param1, param2); if (!param2) { let data2 = await service.getData2(); data1 = data1.filter(....something with data2....); } return data1; } I am feeling like I am writing state machine in observables instead of compiler doing the same for me with promises/await/async. All these simple examples from courses work fine, but with something more difficult I feel like observables suck
@MonsterlessonsAcademy Жыл бұрын
Well you need to learn rxjs a bit more. Unfortunately I don't help with the code in the comments because it takes a lot of time. Check some of my videos on rxjs kzfaq.info/get/bejne/aLpjeZiFy9i9p30.html kzfaq.info/get/bejne/aOB6hdpkqNLDhqc.html kzfaq.info/get/bejne/iqyIo9KSx92mlok.html
@mehdi-vl5nn Жыл бұрын
Observable = Observer pattern + iterator pattern
@MonsterlessonsAcademy Жыл бұрын
Yeap!
@thmscq5713 Жыл бұрын
but using observables kinda wastes the big potential of await, doesn't it? if we want a synchronous function we have to transform it into a promise each time
@MonsterlessonsAcademy Жыл бұрын
I think you understand it wrong. Await doesn't make your function sync. It just looks sync and every next line with await waits for previous line to be done. But it is still 100% async. Regarding your question async await is just sugar for promises. You don't get anything new and it has all the same problems.