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?
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...
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.
We're a place where coders share, stay up-to-date and grow their careers.
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?
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...
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.