What is a JavaScript Reducer Function???

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.ย. 2021
  • If you have started to learn about state management with JavaScript then you have likely heard about reducer functions. This video explains the concepts behind reducer functions with a couple simple examples.
    Code from video: gist.github.com/prof3ssorSt3v...

ความคิดเห็น • 21

  • @ambermullen8285
    @ambermullen8285 9 หลายเดือนก่อน +1

    The Archer reference was.... chef's kiss! Thanks for the tutorial!!

  • @georga.9236
    @georga.9236 2 ปีที่แล้ว +2

    Steve, as a new subscriber I wanna say a big thank you! I have watched quite a few of your videos and the explanation's always stellar! Keep on rocking

  • @kedarpethe
    @kedarpethe ปีที่แล้ว

    best way to explain this concept!!!! Redux becomes a piece of cake !! Your friendly way of explaining complex concepts is magical!!!
    ..Although, for the benefit of the readers... i want to point out that....
    ....
    The simplest way to understand a reducer is to think of reducer operation flow as unidirectional.... they just go 1 way from left to right.... reducing --> reducing more --> reducing more more -> reducing more more more .... how to reduce them is decided by actions (i.e.- strategy).......

  • @falanges5301
    @falanges5301 ปีที่แล้ว

    Thanks for your comprehensive explaination about this topic Steve, you are amazing

  • @Rocky-qd1sp
    @Rocky-qd1sp 2 ปีที่แล้ว

    Thank you so much. The video i watched before yours didn't help me a lot. Your video gave me a crystal clear explanation

  • @dfgndfghdfghdfgh
    @dfgndfghdfghdfgh 2 ปีที่แล้ว

    I go to your videos over videos by people like mosh or Cs dojo now. Not to say they aren't great teachers but I find your manner of casual explanation and example to be more understandable. Thank you.

  • @avinashgardasalgonquin4371
    @avinashgardasalgonquin4371 2 ปีที่แล้ว +1

    I'd like to join Mobile app dev course prof. Steve, but right now I'm into Web dev course. Neat explanation of Reducer!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว

      Sorry you are going to miss out on all the cool web dev stuff that we do.

    • @avinashgardasalgonquin4371
      @avinashgardasalgonquin4371 2 ปีที่แล้ว

      @@SteveGriffith-Prof3ssorSt3v3 I was afraid I'd miss all the fun part of web dev :( it does hurt. By any chance can I change my course in the winter intake?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว

      @@avinashgardasalgonquin4371 we don't have a winter intake, only Fall.

  • @michaelcuccia470
    @michaelcuccia470 2 ปีที่แล้ว +1

    This is a great explanation!

  • @kllokoq
    @kllokoq 2 ปีที่แล้ว +1

    Perfect! This explains the concept with vanilla Javascript. So good to know the basics from where the concept originates. Thank you!
    We can now manage state in simple apps that need it, but don't need the whole React library I guess!

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว +2

      It's Redux that you don't need when you manage your own state.
      With the new Context API plus the useState and useEffect hooks you can do most of what Redux was doing.
      Redux was always something that you needed for larger solutions anyway. Simple sites worked fine with setState and passing props.
      React is the virtual DOM part that creates views. With react-dom you render to the browser and react native lets you render your views as actual native components. You could, if you want, build your own virtual DOM with vanilla JS... then you need the code to compare and watch for changes (the harder part to do efficiently).

    • @kllokoq
      @kllokoq 2 ปีที่แล้ว +1

      Thank you Steve!

    • @avinashgardasalgonquin4371
      @avinashgardasalgonquin4371 2 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 yes Steve!

  • @darshancj483
    @darshancj483 ปีที่แล้ว

    The tactical turtleneck!

  • @RogerThat902
    @RogerThat902 2 ปีที่แล้ว +2

    This video should be required to explain the basic concepts Redux uses.

  • @systemmanager186
    @systemmanager186 2 ปีที่แล้ว

    pretty comment in React went dealing with complex state or working with Redux

  • @HarshKapadia
    @HarshKapadia 2 ปีที่แล้ว +1

    Really nice video!
    BTW, why are these functions called 'reducers'?

    • @SteveGriffith-Prof3ssorSt3v3
      @SteveGriffith-Prof3ssorSt3v3  2 ปีที่แล้ว +2

      They reduce the old state, the action, plus potential new values into a single new state value.

    • @HarshKapadia
      @HarshKapadia 2 ปีที่แล้ว +1

      @@SteveGriffith-Prof3ssorSt3v3 makes sense. Thank you!