RxJs Schedulers - Why do we need them? (Advanced, 2021)

Sdílet
Vložit

Komentáře • 58

  • @DecodedFrontend
    @DecodedFrontend  Před 2 lety +5

    If would like to know more how browser handles async stuff, event loop, etc then please check this video. It is probably the best explenation I have every seen czcams.com/video/8aGhZQkoFbQ/video.html

  • @Lokus122
    @Lokus122 Před 2 lety +25

    I answered correctly to all interview questions thanks to this channel

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +1

      Really love to read stories like yours and I happy that my channel helped with that❤️ thanks for such a feedback!

  • @lovejonsson8327
    @lovejonsson8327 Před 2 lety +9

    I really appreciate that you don't cut your videos so hard like a lot of other channels do. I much prefer the fluency that you bring and then having small asterisk's and "correction" frames here and there. It's easier to follow imo. Great content superbly presented as always, thanks a lot! Wish you a great weekend!

  • @Billiam112
    @Billiam112 Před 8 měsíci +1

    Best angular resource on youtube. I really hope you'll hit 100k followers within next year!

  • @wojciechtrawinski75
    @wojciechtrawinski75 Před 2 lety +3

    Nice explanation 😉 other use cases I can think of: mocking data with the of observable with asyncScheduler so that it behaves as with real data and during testing RxJS streams which are time based - using Test scheduler

  • @debmallyabhattacharya4394

    Possible use case: Mocking API call delays.
    Useful during unit testing.

  • @user-ep4sy2qo6q
    @user-ep4sy2qo6q Před 11 měsíci

    кайфую от твоей подачи) Помогает вырасти от уровня джуна -> мидла. От души Димон)

  • @p.s29
    @p.s29 Před 2 lety +3

    Real life use case... 😅
    Thank you for uploading.

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +1

      yeah.. as I said I have never used it in my daily work, so it was the best I could come up with 🤷🏼‍♂️😄

  • @a_lodygin
    @a_lodygin Před rokem +1

    I usually use animationFrameScheduler with fromEvent(this.window, 'resize').
    Also, it's useful to use with dynamic components. You can reduce frame drops during appearing of a component by scheduling the painting phase on the next frame (you shouldn't compute all the necessary stuff for component creation and draw it in the particular frame simultaneously)

  • @malyna
    @malyna Před 2 lety +1

    Дякую! Чудове пояснення!

  • @user-uh7vf8rn4b
    @user-uh7vf8rn4b Před 2 lety +19

    ngx-rxjs-zone-scheduler leaveNgZone scheduler can be used to run some code outside of ngZone. For example if you need to do some heavy computations, but you split them into several 10ms computations to leave the UI working - with this scheduler unnecessary change detections won't be run.
    Even Dmytro's example with loading animation could be improved, because it is unnecessary to run the change detection on every frame in this case, and styles could be updated without CD

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +6

      Awesome! I didn't know about that ngx-rxjs-zone-scheduler library, thank you! And good point regarding CD, it didn't mentioned it because it is a bit another topic but I hope my audience read comments ;)

    • @user-uh7vf8rn4b
      @user-uh7vf8rn4b Před 2 lety +5

      @@DecodedFrontend Yeah, I wasn't trying to say that the implementation in the video is bad. It is great for describing a concept. Just proposing some kind of "real life use case" ;)

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety

      @@user-uh7vf8rn4b and it was really awesome example! Currently investigating the lib you sent :)

    • @user-uh7vf8rn4b
      @user-uh7vf8rn4b Před 2 lety

      @@DecodedFrontend I have never seen it myself. Just googled it, because I thought there is such thing for sure :D

    • @ykristianhd
      @ykristianhd Před rokem

      What does CD mean? I'm new in RxJS 😊

  • @rhea8133
    @rhea8133 Před 2 lety +1

    I feel so empowered when i see your videos. and your wording and method of speech is so easy to understand and connect to. i look forward to every single of your videos. keep up the awesome work and thanks a lot !

  • @arny699
    @arny699 Před rokem

    Thank you. Really useful, especially your example with execution context.

  • @bennineo6372
    @bennineo6372 Před 2 lety

    Very nice. Thanks for posting!

  • @thm007
    @thm007 Před 2 lety +1

    Brilliant explanation! Thank you!

  • @vivmaniaa
    @vivmaniaa Před 2 lety +2

    You are awesome, Thank you for this video.

  • @hoangducnguyen8887
    @hoangducnguyen8887 Před rokem +1

    Great video, I learn a lot!

  • @abdallahmeddah8461
    @abdallahmeddah8461 Před 10 měsíci

    You can encounter this when you do rxjs testing, controlling the scheduller will help avoiding flaky tests

  • @vitaliikarpenko5828
    @vitaliikarpenko5828 Před 2 lety

    Man, you are really cool. I'm so happy that I've found you!

  • @tarassavchenko2317
    @tarassavchenko2317 Před rokem

    this example of async is just a masterpiece, you are goood)

  • @demidovmaxim1008
    @demidovmaxim1008 Před 2 lety +1

    Thank you so much!!!! It's great info

  • @nelson3391
    @nelson3391 Před 22 dny

    Great explanation. Thanks a lot

  • @MatiasAlibertti
    @MatiasAlibertti Před 2 lety

    Great content!

  • @markiianproniuk5741
    @markiianproniuk5741 Před 2 lety

    thanks for the video, looks interesting

  • @samucancld
    @samucancld Před rokem

    great content 👍

  • @aregsargsyan7689
    @aregsargsyan7689 Před 2 lety +3

    I am faced with this problem just yesterday) thx for explanation Man

  • @markfrances4969
    @markfrances4969 Před 2 lety +1

    really nice explaination

  • @rezyadlf
    @rezyadlf Před 2 lety

    Dat "Small Note" appeared so suddenly, like some screamer in horror games )))

  • @zaktreister1995
    @zaktreister1995 Před 2 lety

    Amazing I love your content

  • @jacksonoppenheim956
    @jacksonoppenheim956 Před 2 lety +5

    This was awesome and super informative! I’ve always wondered why SchedulerLike was a type in so many operators!
    What would you think about a video on writing tests with observables? Maybe marble tests? I’ve always struggled to understand how to get those working, but I see all over the place that they’re really useful and help you understand how observable work.

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +1

      Great suggestion! I had already thoughts regarding it, so maybe any time soon I will make it ;)

  • @HenrikBgelundLavstsen
    @HenrikBgelundLavstsen Před 2 lety

    I actually had an issue with a timer bar with continuously adjusting times. It had weird lags, but i did not know about the animationFrameScheduler. Seems to work like a charm

  • @nobitanoby7609
    @nobitanoby7609 Před 2 lety +2

    I really owe you so much... you are my demi god..❤️❤️

  • @beodan9219
    @beodan9219 Před rokem

    awesome

  • @user-jl1jz5jv1g
    @user-jl1jz5jv1g Před 2 lety +3

    Димон красавелла)давай про горячие и холодные обсерваблы и где это может пригодиться!

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +1

      Ну кстати есть уже в планах))

  • @2762123
    @2762123 Před 2 lety +1

    nice video

  • @ammardiarra1387
    @ammardiarra1387 Před rokem

    games , in real times reports , thats somes of the appliations

  • @praktycznewskazowki6733
    @praktycznewskazowki6733 Před 2 lety +2

    pierwszy!

  • @pashabiceps95
    @pashabiceps95 Před 5 dny

    14:49 but why?

  • @krisnarusdiono1304
    @krisnarusdiono1304 Před 2 lety

    So far i am practicing myself to use async and await on my script in order to force it to execute any API request one by one, i still have to learn much to implemet rxjs operator in my project lmao. Dymitro, i just wondering how to get such a realtime notification on my project? like when someone posting a new student data's then it will push other user a notification (either couter at bell icon or a snackbar).

    • @krisnarusdiono1304
      @krisnarusdiono1304 Před 2 lety

      oh, and i just realize that your channel grow up so fast ... last time i see you still have around 2k subs. now look at that!
      no doubt why you grow so fast ! congrats!

  • @akashchandran1
    @akashchandran1 Před 2 lety +2

    I have one doubt here.
    1 - console.log("Regular console log");
    2 - requestAnimation Frame (() => console.log("Animation frame callback"));
    3 - setTimeout(() => console.log("setTimeout callback"), 0);
    4 - Promise.resolve("Promise value").then(console.log);
    5 - of ("Stream value").subscribe(console.log);
    why the "stream value" printed even before the "promise value". Could you please explain that a bit?
    Thanks

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +1

      It is because requestAnimationFrame, setTimeout, Promise are async operations when console.log and of("Stream value") are sync. Async operations will be executed always after sync ones, so that's why "stream value" is printed before promise

    • @akashchandran1
      @akashchandran1 Před 2 lety

      @@DecodedFrontend subscriptions are also async right 🤔. I may need to read more about it 🙂

    • @DecodedFrontend
      @DecodedFrontend  Před 2 lety +6

      @@akashchandran1 not all of them :) They can be sync and async. As example of("Stream value").subscribe(console.log); is sync but if you do something like: of ("Stream value").pipe(delay(0)).subscribe(console.log); it will make it async :)