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.

  • @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.

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

    great example. and for some reason I am hungry!

  • @ramielwan48
    @ramielwan48 Рік тому +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 UA-cam for everyone

  • @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

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

    nice video.

  • @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.

  • @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.

  • @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.

  • @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?