Closures, Currying and Partial Application

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2021
  • This tutorial explains the concepts of Closures, Currying, and Partial Applications.
    Next it reviews a simple typical demo of how currying and partial application are shown.
    Finally, a real world example where partial application is used in conjunction with fetch, async, and await.
    Code from video: gist.github.com/prof3ssorSt3v...

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

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

    Actually the first example on currying that really makes the thing "click".
    Thank you Steve, as always. You save us from the fog in the JS forrest : )

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

    Great tutorials! Your style of teaching is very effective.

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

    great example. and for some reason I am hungry!

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

    Been waiting for this. Thank you as always, Steve.

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

    Love the quality, thanks Steve.

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

    Great example Steve. Thanks.

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

    Best teaching

  • @Dom-fs8om
    @Dom-fs8om ปีที่แล้ว

    Awesome tut. You should sell courses and teach. Your teaching style is very effective

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

      I do teach full-time as a professor at my local College. I decided to keep all my content free on TH-cam for everyone

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

    nice video.

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

    Man IDKU, but if for any chance I meet you, I'll invite you the best dinner I can pay. You Rock! TYVM

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

    If i understand correct, we use currying / function composition when we have some actions that repeat and we don't want to declare a new function everytime with multiple parameters, instead of declaring a single composer function which we invoke many times instead? Is the main reason behind currying/composing functions to save memory and don't repeat code?

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

      It is more to do with striving towards pure functions that each do a single thing without any side effects. Making a series of logical steps with pure functions leads to less error prone code.

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

    nice video. why do you need to sleep if you are awaiting calls to jsonPlaceholder in init?

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

      don't have to. Just wanted to use a delay to show that the results were being used at some time in the future instead of as soon as they were available.

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

    Ok, .mjs was new to me... The benefits of that could have been a topic of its own, like your top level async await.

  • @Horse-tradeEu
    @Horse-tradeEu 2 ปีที่แล้ว

    chocolate vanilla curry cupcakes:p Sounds like advanced JS

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

    React Hooks use this concept, am I right?