DEV Community

loading...

Discussion on: 3 Simple JavaScript Changes

Collapse
conermurphy profile image
Coner Murphy

Love the article, some tips I had never really thought of and will try to implement more in my day to day.

My only question is around the currying. You mention partially applying a function and only executing only all the arguments are received. I may be wrong but couldn't this be achieved using async / await functions?

Collapse
rikbrowning profile image
Rik Browning Author

I am glad you liked the article!

Whilst you could use async/await I would recommend not using Promises unless the action is truly asynchronous as it introduces overhead that is not necessary. I would recommend digging around the ramda library on github to see how the implement their curry. github.com/ramda/ramda/blob/master...

Collapse
conermurphy profile image
Coner Murphy

I suppose this something I haven't thought about, I just assumed promises would be efficient but I guess they do add overhead to the code having to wait and keeping checkung.

Thanks for pointing it, I'll check out that library and see how they do it.