Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

We use currying at work to inject dependencies. E.g.

`sendEmail(mockEmailService)(to, subject, body) `

I find it helps to differentiate between side-effecting dependencies and parameters, making code purer, easier to test, more scalable etc.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: