Це відео не доступне.
Перепрошуємо.

Rxjs Streams in Angular - Normalizing Data (Map and Pipe Operator)

Поділитися
Вставка
  • Опубліковано 17 сер 2024
  • In this video you will learn what are RxJS streams in Angular. We will check on the real example how convenient it is to use RxJS map and pipe methods for normalizing data inside our service from observables which we are getting from API.
    🚨IMPORTANT:
    → Advanced Angular course: monsterlessons...
    → All my courses: monsterlessons...
    → Twitter: / monster_lessons
    🕛 TIMESTAMPS:
    0:00 Introduction
    1:26 What are streams in RxJs
    3:40 Normalizing data with RxJs in Angular
    6:04 RxJS pipe and map methods
    11:39 Call to action
    📚 References:
    → Angular for beginners - Full Playlist: • Angular Course Online ...
    → Source code: github.com/mon...

КОМЕНТАРІ • 77

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  3 роки тому +2

    Watch next: Angular 2 Routing and Navigation - Tutorial and Example - ua-cam.com/video/XqSNUXI4Hb0/v-deo.html

  • @manojkarthik6158
    @manojkarthik6158 2 роки тому +3

    He may be talking like a robot but the content is extraordinary.

  • @charleso6513
    @charleso6513 2 роки тому +2

    Very well explained. Its difficult sometimes finding a clean explanation of these functions but this one helped me actually understand it properly. Thank you!

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому +1

      Here is a follow up for you on this topic
      ua-cam.com/video/2T3F5TfrYwI/v-deo.html

  • @TauwinKul
    @TauwinKul Рік тому

    Your intro and outro are world class. Not to mention the content of your short videos.

  • @ayush03d
    @ayush03d 3 роки тому +2

    Thank you so much! I have seen around 10 videos on this topic and this is the best video that has cleared my doubt! Subscribed!

  • @raulherbert
    @raulherbert 2 роки тому

    great explanation! tks!

  • @omar-elgammal
    @omar-elgammal Рік тому

    such a great Explanation ! keep up the great work

  • @leandrodossantos9160
    @leandrodossantos9160 2 роки тому +1

    Bro, I found this a little later but it is a great explanation, thanks man!

  • @mybootscamewithoutstraps
    @mybootscamewithoutstraps 11 місяців тому

    I can see that you've made improvements over the years with your videos to work on how you use inflection in your voice. It still feels really robotic when listening to the content, but you definitely have concise lessons that get things across the way they need to be.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  11 місяців тому

      Wow, thank you!

    • @mybootscamewithoutstraps
      @mybootscamewithoutstraps 11 місяців тому

      I think once you really get down the inflections of your voice to be more natural and uplifting, your stuff should really grow a lot. When an instructor is easy to listen to and has a nice speaking rhythm, it makes it way easier to absorb the content and learn.@@MonsterlessonsAcademy

    • @CatEatsDogs
      @CatEatsDogs 9 місяців тому

      @@mybootscamewithoutstraps I would listen to you speak any language that is not your native one. Slavic for example. And how you use inflections in your voice.

  • @ilkerberkeelcioglu1130
    @ilkerberkeelcioglu1130 2 роки тому

    Very well and detailed explained. Thank you, it was very helpful!

  • @pgc1721
    @pgc1721 2 роки тому

    Perfect explanation. Just top notch.

  • @FMAlmeidaLeite
    @FMAlmeidaLeite 2 роки тому +1

    Me ajudou muito, obrigado! 😁

  • @girish2555
    @girish2555 2 роки тому

    Crystal clear 🔥

  • @MatheusSantos-rh5jo
    @MatheusSantos-rh5jo 2 роки тому

    Thanks sir! Help me a lot!

  • @dipabhow4630
    @dipabhow4630 3 роки тому

    Very good video for map operator... thanks for it man...

  • @luca-rw7ss
    @luca-rw7ss 3 роки тому

    Very Very good explanation! Thank you.

  • @satviksharma4897
    @satviksharma4897 2 роки тому

    Very well explained

  • @leonidesmuguercia4211
    @leonidesmuguercia4211 Рік тому

    Nice 👍!!

  • @abdulaziz7013
    @abdulaziz7013 2 роки тому

    excellent sir, very helpful real-time example

  • @karnpratapsingh8860
    @karnpratapsingh8860 2 роки тому

    very nice explanation.

  • @MrCyurasys
    @MrCyurasys Рік тому

    Your video is very good.
    I have only one mention:
    In method getUsers you could have used return users.map(user => user.age += ' years old')
    I dont think it is needed to return a new object but just return the same one and modify only the properties you need

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Рік тому +1

      That is possible but it is safer to write immutable code and never mutate any properties (which I typically recommend to do). Then you never get the situation that your code is suddenly changed from random place.

  • @adhivenkatesh3431
    @adhivenkatesh3431 2 роки тому

    Hi Olex , its great video , is there any videos for angular chatbot with room , videos need for tips in angular

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      Hi Adhi, I have a new couse in Angular, Typescript, Socket io, Mongodb, Express where we build trello clone. Although it is not a chatbot but the websockets concepts are similar
      monsterlessons-academy.com/courses/build-fullstack-trello-clone-websocket-socket-io

  • @kshitijbhatt11
    @kshitijbhatt11 2 роки тому

    Is the online course still maintained? The website didn't look really responsive hence I am skeptical. But this is the best video i have seen on rxjs streams for angular. Really interested in advance angular course if it's still maintained.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      You mean Angular NgRx course? Yes it is. It works on Angular 13 with 1 ngrx change where we inject it in other way which I mention in the course.
      I'm open to changes on website just send me an email with screenshot what is not responsive and I will check.

  • @HM_Milan
    @HM_Milan 2 роки тому

    Thank you

  • @Georgii1212
    @Georgii1212 Рік тому

    Hello! Thanks for the excellent tutorial. One question. In the UserService, if I want to implement a method that returns Observable of only one user, the youngest one, what would be the code ? The important thing is that I want the service to return the observable of this user...So sorting by age would be done in the service, on the list of users.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Рік тому

      You can just call sorting by age and take first element inside map of rxjs with Javascript

    • @Georgii1212
      @Georgii1212 Рік тому

      @@MonsterlessonsAcademy thanks a lot for quick answer. So, we keep the same rxjs functions pipe() and map(), that you have described for getUsers(), and just adapt the callback function inside map. I thought was necessary to use switchMap instead of map, but I was obviously wrong. And I guess the signature of this method would be getYoungestUser(): Observable

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Рік тому

      @@Georgii1212 Yeap

  • @BGivo
    @BGivo 2 роки тому

    One thing I don't quite understand. When you "subscribe" to a stream, and the value in the stream changes, would the component that was subscribed to it automatically render on its own? (or is this something you need a BehaviourSubject for?)

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      Subscribe doesn't do anything with component. Only changing of the property will render template again. You typically use subscribe to call some other function. If you just need to rerender stream property it's better to use async pipe
      {{foo$ | async }}

    • @BGivo
      @BGivo 2 роки тому

      @@MonsterlessonsAcademy Sorry I should have been more clear. Even with the async approach, if the value in the stream changes, would the component that has the async pipe automatically rerender with the new value?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      @@BGivo yes exactly. That is the whole point of using RxJS with Angular

    • @BGivo
      @BGivo 2 роки тому

      @@MonsterlessonsAcademy Thank you. So if that's the case, what's the point of the BehaviourSubject then?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      @@BGivo To create a stream where you can subscribe and update it anytime by using next.

  • @HoNow222
    @HoNow222 3 роки тому +1

    Very cool angular videos!! But please you should think about using a more friendly IDE like VScode :)

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  3 роки тому +2

      Unfortunately it's not friendly for me and I can't be as productive there as I'm with Vim

  • @amannegi8256
    @amannegi8256 2 роки тому +2

    awesome video , but try smiling sometimes.. :)

  • @yuraflokadrift
    @yuraflokadrift 8 місяців тому

    Друже, ти українець?

  • @auchucknorris
    @auchucknorris 2 роки тому +1

    at 10 minutes is exactly why i dislike typescript, front end code your constantly manipulating data, so much extra work, for a benefit that doesn't matter on front end code, ur not going to ruin a database so its only purpose is to throw errors

    • @aakashpoojary3968
      @aakashpoojary3968 Рік тому

      Hence backend helps a lot in such cases. If an api sends a nice, clear outputs there will be no need to transform data

  • @denns0r
    @denns0r Рік тому

    I don't see why http requests are observables. Observables can only have ONE observer, and HTTP requests will complete or error after they are executed. Yes, I can combine multiple observables and mutate their data, but I can do that with promises as well ... native. Plus I can simply await one or multiple promises that can be fired sequentially or all at the sime time. And I do not have to store subscriptions to unsubscribe if my component destroys itself.
    Subjects can have multiple observers and they can emit different values over time, okay I can see the use of that, but I don't understand why http requests are observables. The ONLY usecase, where observables are superior in http requests is when I can use switchmap to cancel them. But for that I need an input stream as well ... 🙄

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  Рік тому +1

      I think you need to address your questions to Angular team and it's architecture.
      It is what it is. Using Angular with streams in the way how Angular was planned is easier that fight with bugs when using Angular in a way which was not intended.

  • @jannickbreunis
    @jannickbreunis 2 місяці тому

    Great video. Saw pipe() and map() everywhere but now I actually understand what they do. Your video about other methods is a great follow up: ua-cam.com/video/2T3F5TfrYwI/v-deo.html

  • @Nafiganado
    @Nafiganado 2 роки тому

    This guy looks like Christopher Walken

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 роки тому

      Lol I can see similarities. I hope to look that good when I get older :)

  • @surendra_tarai
    @surendra_tarai 2 роки тому

    its a dead man

  • @dreamether7808
    @dreamether7808 2 роки тому

    lol does this dude have a soul? he sounds dead inside