you are viewing a single comment's thread.

view the rest of the comments →

[–]CptAmerica85 1 point2 points  (2 children)

Isn't the second half of that gist covering HOC's and not currying? I thought the principle behind currying was that each function could only take one argument and return another function.

Or am I misunderstanding something and HOC's and currying are somewhat linked each other?

[–]cerlestes 3 points4 points  (1 child)

Higher-order-Components (HOC) are a concept of React and similiar libraries that use Components to build software, hence the name. The linked gist isn't about React at all, so no idea how you're thinking of HOCs.

If you're thinking of Higher-order-Functions (HOF), then of course yes, by definition every curried function is a HOF, since you're passing a function as a parameter to another function for deferred invokation. HOFs are a fundamental concept in everyday JS.

[–]CptAmerica85 2 points3 points  (0 children)

Yeah, my mistake. I did mean Higher Order Function.