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...
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 : )
Great tutorials! Your style of teaching is very effective.
Been waiting for this. Thank you as always, Steve.
Love the quality, thanks Steve.
Great example Steve. Thanks.
great example. and for some reason I am hungry!
Best teaching
Awesome tut. You should sell courses and teach. Your teaching style is very effective
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
Man IDKU, but if for any chance I meet you, I'll invite you the best dinner I can pay. You Rock! TYVM
nice video.
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?
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.
Ok, .mjs was new to me... The benefits of that could have been a topic of its own, like your top level async await.
nice video. why do you need to sleep if you are awaiting calls to jsonPlaceholder in init?
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.
chocolate vanilla curry cupcakes:p Sounds like advanced JS
React Hooks use this concept, am I right?
Pretty much every JS framework and library does.