Thanks Osinachi. I appreciate your kind words. The purpose of the article was to create a confident Impression on seeing such a high-other-function or curried function.
To your question, I would say, we don't need destructuring in this context. Especially when we do React by using the "connect".
Eg: connect(mapToStateProps)(AnyComponent).
In this case, we have used a high-other function in such a way that closure is established between the "mapStateToProps" and "AnyComponent".
Please let me know if I answered your question.
Thanks again friend.
Osinachi Chukwujama
Web developer + Technical Writer
Thank you for sharing your knowledge.
I still haven't understood why this currying approach is considered. I think it's easier to destructure the parameters like this
const checkBankDetails({ username, userNameRegex, acctNumber, acctNumberRegex }) => {}It gives more flexibility on how the function should be called. But apart from that, thank you for writing this blog.